Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Memory Leaks
Message
From
23/07/2008 17:19:36
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
 
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01333545
Message ID:
01333562
Views:
13
>>No memo fields and we can watch the used memory grow as it is running. I asked in the other thread, but why is the RETURN a bad thing in the WITH/ENDWITH?
>>
>>Update: And does that mean any type of RETURN, like this?
>>
>>
>>RETURN CHRTRAN( InputText, CharsToStrip, '')
>>
>>
>>>You sure it's a memory leak? I've seen issue when using memo fields alot. Also make sure you don't have a RETURN inside a WITH/ENDWITH.
>>>
>>>>What are the first places to look for memory leaks in code? We have something that runs a process and the longer it runs (more records) then the memory keeps growing until all the available is chewed up and it crashes and burns.
>
>RETURN is fine normally.
>
>What Craig was referring to was using a RETURN in the middle of a WITH/ENDWITH block. I've never encountered that but I assume VFP would wind up creating a stack of memory variable names that it is trying to resolve to object properties that will grow tremendously as the program executes without properly terminating the WITH statement.

Ok, want to make sure I understand. This is going to really make my code hard to read if I have to change each object/reference to explicitly state the parent. I definitely have the conditions shown below in my code. Is this the scenario that causes a problem, and is the only solution to not have a RETURN inside the WITH/ENDWITH?
WITH oObject
     RunSomething(.Child_001)
ENDWITH

WITH oObject
     NewChild = RunSomethingElse(.Child_002)
ENDWITH


PROCEDURE RunSomething

     PARAMETER tChild

     Do something with tChild

     RETURN


PROCEDURE RunSomething

     PARAMETER tChild

     Do something with tChild

     RETURN tChild
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform