RE: Release memory?
- Posted by Andy Serpa <renegade at earthling.net> Sep 18, 2002
- 492 views
Derek Parnell wrote: > >From my understanding, this action will only "release" memory for the > application to reuse, it will not release memory for other applications. > > Each time a Euphoria program need more memory for a sequence operation, > the > memory is taken from the program's heap, but if the heap is not large > enough > the program grabs a bit more RAM from the operating system (thus > increasing > the size of th eprogram's heap), and the heap is not returned until the > program ends. > > This also applies to allocate() and allocate_string() calls. > So then it would still be a good idea to keep it freed "internally" so that it will not need to grab as much from the OS as the program keeps running. In fact, if we can never "give the memory back" until the program exits, it makes it even more important not to have a bunch of global variables with large sequences that we are finished with, eh?