Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trying to track down memory leak(s)
Message
 
 
To
23/09/2011 13:29:40
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01398453
Message ID:
01524515
Views:
85
>>>>Do you think this particular method can be a source of the error?
>>>>
>>>>The external application calls this dll with the 'Invoke' call passing an XML string with parameters. Then invoke method parses the string, calls appropriate method of the class and returns back usually an xml string or a string.
>>>>
>>>>UPDATE. With commented MySQLExec the first call of GetItem method takes 0.02 sec. and last call takes 0.14 seconds, so there is still a memory leak.
>>>
>>>
>>>(1) try releasing lcSource as well
>>>(2) If the method does not change tcSource, pass it by reference - but do not release it here
>>>(3) You have multiple exit points (release )
>>>
>>>(4) I do not think that the difference between .14 sec and 0.02 sec is an indicator of a memory leak
>>
>>Making a switch from passing parameter by value to by reference didn't help. I see the exact same thing - 0.03 to 0.14
>
>
>This was just to avoid the copy of tcSource on the stack. Passing by value copies the contents of a variable. If the variable is a 16MB string, you end up with 32 MB for the duration fo the call

The string is never that big. It is usually rather small - just a few parameters embedded in the string. For MySQLExec the strings are also not too big - but I changed to pass them by reference as well.

If you'd like, I can send you the latest log file. I can increase verbosity level (I was using the smallest one to only record main info).
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform