Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Figuring out VFP crashes
Message
 
 
To
01/03/2017 16:54:07
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Database:
MS SQL Server
Miscellaneous
Thread ID:
01648682
Message ID:
01648705
Views:
63
>>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.

I added inkey(1) before recording the memory. All I did is opened the form and closed it (didn't do anything). This is what I got in the log

2017.03.01 16:04:16.442 ADMIN NAOMI 5 Booking_Schedule form loading... Memory currently used is 3336 BOOK_SCHEDULE.LOAD() WEBPAGES
2017.03.01 16:04:26.315 ADMIN NAOMI 5 Booking_Schedule form destroying... Memory currently used is 5891 BOOK_SCHEDULE.DESTROY() WEBPAGES
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