Page 1 of 1

lof / freememory

Posted: Sun Feb 05, 2006 2:31 pm
by Fable Fox
I'm a newbie in PB, but after looking at 'lof / length of file' example, I suggest FreeMemory(*MemoriID) is called after CloseFile(0), or does PB have automatic garbage collection that help the user?

Thanks.

Posted: Sun Feb 05, 2006 2:35 pm
by Trond
The memory is freed the program ends. Or you can free it manually like you suggested.

Posted: Fri Dec 22, 2006 1:39 am
by eriansa
Can somebody explain exactly when the garbage collector will start.
I thought that garbage collection was done in runtime, or does PB's garbage collector run only on exit?
What about a lot of runtime strings used in an app?

Posted: Fri Dec 22, 2006 1:01 pm
by Trond
eriansa wrote:Can somebody explain exactly when the garbage collector will start.
I thought that garbage collection was done in runtime, or does PB's garbage collector run only on exit?
What about a lot of runtime strings used in an app?
PB doesn't have ordinary garbage collection. But when the program ends, all allocated memory is freed.
Strings are freed exactly at the moment they are not longer used.