Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Figuring out VFP crashes
Message
De
01/03/2017 16:54:07
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Database:
MS SQL Server
Divers
Thread ID:
01648682
Message ID:
01648704
Vues:
81
>Should I be concerned with these numbers - I run a single test and didn't do much
>
>Booking_Schedule form loading... Memory currently used is 3840
>
>Booking_Schedule form destroying... Memory currently used is 5934 (using sys(1011))

..I think that you have something, because this is not memory, but memory handles.
In C language, when you need to use variables, arrays and other type of data from Heap memory, you need to "open" (reserve) that memory to use it (like the fopen in VFP for low level file handles), but once that this memory was used must be given back to the system, so you "free" that handle (like the fclose()) so the memory segment is free. If you do not close that memory handle or you misuse the reserved memory segment, then you have memory leak, and I think that this is what is happening here.
You can have a little amount of handles of difference (may be 10 or 20 that eventually should clean up), but having more than 2000 memory handles leaked are too much.

You should put this function before and after some operations (methods) and even at a form level (before loading and after releasing) and may be adding a INKEY(1) (just for testing) to let the VFP automatic collector do his job, and measure the handles again to make sure that this numbers are so high.

Every memory assignment, object reference and the like uses memory handles, so take care of cross-object references too, like passing object references to the form that are saved as properties or the like.
Fernando D. Bozzo
Madrid / Spain
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform