Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Memory Leaks
Message
De
23/07/2008 17:19:36
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01333545
Message ID:
01333562
Vues:
11
>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform