in reply to break out of enless loop does not release memory

I think you're being bugged by the typical problem that releasing contents of variables doesn't release the memory back to the OS. That only happens when the program quits.

You don't seem to be in a hurry. Why not just restart the program? This script shows the concept:

use appiqcli; my @eventlist = appiqlist(-event -all); sleep(10); exec $^X, $0;
You may have to add any extra parameters.

Note: $^X is the full path to the current perl interpreter, $0 is the name of the script. And yes, it works on Win32.

You can watch out for a keypress in that sleeping period, and not do the exec statement if you see one. Or, just have the user press ctrl-C.

Replies are listed 'Best First'.
Re^2: break out of enless loop does not release memory
by Limbic~Region (Chancellor) on Feb 21, 2007 at 14:11 UTC
Re^2: break out of enless loop does not release memory
by Anonymous Monk on Feb 21, 2007 at 12:59 UTC

    Interisting concept. It ried your Idea but what happend is the virtual memory grew every time it executed the exec

    Interesting was: when I ran out of virtual memory I had to close the cmd.exe and the windows popped up the END NOW window, when I clicked END NOW it released a block of the used virtual memory, any Ideas why this happens

    Thank you for your time

      How are you running this script? I would expect the process to end when the script ends, but some engines keep the process in memory and just restart the script. Your comments about cmd.exe are interesting, and implies some kind of zombie process, but they should not take much memory, even on Windows (a couple of 4kb pages, last time I looked).