User Tag List

Results 1 to 2 of 2
  1. #1
    Junior Member
    Join Date
    Aug 2009
    Post Thanks / Like
    0 Post(s)
    0 Thread(s)

    Memory Leak in QALoad\'s CLoadString ?

    I'm using QALoad v5.5 Build 507 with 3 players (70 VUs) to test a web application.

    The QALoad Conductor's test is configured to run 4 transactions per VU. Each transaction does a sign-in, a search, loop 100 times to process 'work items' (when an item is 'saved' the web app retuns the 'next item' automatically) then exit the loop and sign-out. The entire test takes about an hour to run and simulates 2 days of real-time "work".

    At the start of the test, the 3 Players report their "% Memory Used" to the Conductor as (23%, 23%, 25%) respectively and upon completion as (55%, 56% and 55%). I seem to be leaking about 1 MB per VU per QALoad transaction!

    My problem is that if I configure QALoad to run too many VUs or transactions (for example to simulate 1 week of non-stop activity) then the QAPlayers run out of memory and crash.

    The PC's hosting the Players are dedicated to QALoad (the OS for the Players are Win XP/Pro SP2 and one is Win2000 Server, all loaded with MS-IE7) - nothing else is running on them. The Players are not executing any code nor files that are being downloaded during the test.

    Regarding the test script, I used QALoad's VisTree to extract 3 run-time "IDs" to local variables, the generated code uses the 'Get( REPLY, STRING, sStartDelim, sEndDelim)' routine to extract the value and assigns the values to CLoadStrings. I do not see anyplace in the generated code that these extracted strings are freed/de-allocated. Should they be?

    If I add this:
    const char* pBuffer = Get( REPLY, ENTIRE_BUFFER);

    to the generated code, do I need to do a
    free( pBuffer );

    ?? -- I tried including the 'free' -- and this seemed to cause the Player to crash (though it reported crashing at a different line; when I comment-out the "free" then the Player runs without error)...

    Aside from this run-time reference to the 'entire buffer', I suspect that my problem is in my customization of a captured DWR command that saves the work items (I need to replace the 3 QALoad-captured-IDs with the actual run-time IDs).

    The DWR-command to 'save the work item' that was captured by QALoad is big - over 16K, and is assigned to a CLoadString variable. I have a routine that replaces the 3 static-captured-values using a call to "CLoadString.SetSeperator( sStaticValueToReplace )".

    I use the final 16K string by calling

    Set( NEXT_REQUEST_ONLY, POST_DATA , "callCount", dwrBuffer.AsString() );
    dwrBuffer = ""; // trying to free-up memory

    Note: I tried to call "dwrBuffer.Clear();" but the complier throws a warning about
    "Not enough actual parameters for macro 'Clear'"
    then throws a "Syntax error on '(' ".


  2. #2
    Senior Member
    Join Date
    Nov 2000
    Michigan, USA
    Post Thanks / Like
    0 Post(s)
    0 Thread(s)

    Re: Memory Leak in QALoad\'s CLoadString ?

    I used to have memory leak issus until I started using CLoadString as much as possible. Could be related to the size of the string you are working with. You should probably open a support ticket.

    I would suggest that you use CLoadStrings whenever possible such as for 'pBuffer' instead of char*. Also, set your char*'s to null (dwrBuffer = NULL and CLoadString's to "" after every usage.

    How are you handling your customized code you mention for DWR? All of my memory or odd problems have been the result of custum string manipulations.

    The free commands should be at the end of the script before the EXIT command.

    P.s. I don't think you need to use .AsString to the Set command, just pass the CLoadString directly (Casting is automatic).
    A problem is a difference between what is perceived and what is desired, that
    we want to reduce
    (Dewey 1933)



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 09:15 PM.

Copyright BetaSoft Inc.