Qbasicnews.com

Full Version: Garbage cleanup?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Does FB automatically free memory when something goes out of scope?

SUB foo
dim a as intger, b as integer
'code
END SUB

Will it automatically free up the 64 bits on END SUB? I've noticed some memory leaking and I can't figure out if its FB or something else that I am running.
It should clean it up, afaik

If you want to mess with allocate, reallocate and deallocate, take a look at memProcs

Available at plantasy (link in my sig)

It adds some nice functions for memory handling in FB.



Are you using FRE to check the memory?

Windows doesent free all mem immediately it seems, but keeps it, just in case the prog needs some mem again..

If you close the program and then start it, you should have the mem back..
Atleast thats how it seems to be for me.
Neither does VB or any other....Not sure if it keeps it in case it needs or maybe even until the OS commits the disk cache to the hard drive.
FreeBasic always clears up DIM'ed memory upon exiting subs/functions. Static defines however are freed only apon exit. This is what I know...

However it does not control allocate / callocate 'd memory. This you have to free on your own.
could it be FBIde? My memory keeps dropping and triggering my System Mechanic 5 to do a RAM defragmentation and recovery
It's probably Windows, mine does the same..

After a while running my computer i have 0mb free, yet I can allocate 100mb without problem Tongue

Windows buffering/caching wonders..