Chief of Chaos has asked for the wisdom of the Perl Monks concerning the following question:

Fellow monks,

I wrote a big two component application (client-server) which detects some database table differences.
The client holds 2 hashes with the query results.
With these hashes it creates files for the user with the missing and the different rows.

But what happens when it writes the data in the hashes and there is not enougth memory available?
In my experimantal study the process works with a whole cpu and did no further logging.
So I thing it tries (as fast as possible) to allocate memory.

Is it possible to get the size of the memory of a hash/array/variable at runtime, so I can intervene somehow?

In some docu I read that the memory of a process can not be freed while the process is not terminating. So there is no chance to free a hash/array/variable of one application to get more mem for another application. Is this correct?

Best regards,