Interesting that you use the word program instead of process. Is this intentional? On POSIX system, a program can be replaced within the same process using the exec family of functions (Microsoft Windows does not have this feature). These functions replace the text, data, heap, and stack segments, so ordinary perl variables will be destroyed. Some areas of memory are retained between programs within the same process. These include file descriptors and the environment block, so avoid unnecessary environment variables, and close all files before an exec. | [reply] |
I don't know that a "lakh" of data is! I will say that once Perl gains a "lakh" or kilobyte or whatever from the O/S, it will never give it back. Perl will and can reuse this memory for its own purposes. The virtual memory "footprint" of a Perl process never gets smaller.
One of the powers of Perl is that it does the memory management for you! So in general you have no worries! Forget it (or until you get into advanced applications). The O/S will free all memory used by an application when it ends. That is true in Java, C, Perl, etc. There is some very complex stuff about memory management, but if you are dealing with "lakh"'s I don't think you have to worry.
Update: don't worry: Make some hash and when your program ends that memory will be freed. | [reply] |
I think he meant lakh
PS. I'm not OP.
| [reply] |
| [reply] |
No, when the program exits it releases memory | [reply] |
As noted by Anonymous Monk above the memory is freed when the program exits.
Why do you think a hash is different with respect to memory handling than other variables like a scalar or an array?
Do you run into memory issues with your program?
Just wondering
cheers, si_lence
| [reply] |