http://www.perlmonks.org?node_id=399579


in reply to Re: Not able to release memory
in thread Not able to release memory

In my case, I have Tk application running in Win32 environment that never exits. Some of my variables get very large data and as a result - after a period of time, my application "eats" the memory of Windows, and windows complain that the virtual memory is too low. Most of the time - as a result of this - the application gets destroyed by Windows. What I recently found is that if one click with the mouse on the Minimize button of the Tk window, Windows is claiming back the unused memory from perl and everything goes back to normal. For example: from 128MB wperl.exe in the memory, the process size goes to 2MB. Then it starts growing again - until next time you minimize the window. So what I was thinking is that there must be an API call that identifies the process and ask the OS to require the garbige. Correct me if I am wrong. I saw this happens with many applications in Windows. I am desperate for solution about this - because I need to finish my project :(( any help is welcome. Thanks!!!