Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BUG: Memory leak in redimensioning an array
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
BUG: Memory leak in redimensioning an array
Divers
Thread ID:
00864533
Message ID:
00864533
Vues:
55
I (and many VFP programs, I think) use an array to emulate a stack. When values are pushed into or popped from the stack, the array is re-dimensioned on the fly. The users of my program complain that the program is getting slower and slower after using for a period of time. I find that memory leak in re-dimensioning arrays may be an issue. Try the following code:
Declare a_Stack[1]
?Sys(1016)
For i=1 To 100
	Dimension a_Stack[Alen(a_Stack)+1]
	Dimension a_Stack[Alen(a_Stack)-1]
Next
?Sys(1016)
? Alen(a_Stack)
Every time you run the above code, you will find that more memory is used up. The only way to reclaim the memory is to issue a CLEAR ALL command.

Any idea?
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform