I am trying to set aside some memory for my cache (hash/array etc) in my script. I use the ulimit and then monitor used mem with Devel::Size and destroy when i am close to my limit with
. Any ideas on how to do this better?
I know I can allocate memory space by using
but i am not sure how much memory it consumes. Basically my goal is to figure out how to set the max memory a variable can use and how to monitor when the max has been reached.