Michael Peppler
Sybase Consulting
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
Sybase on Linux FAQ
Sybperl FAQ
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Scottzetlan at aol dot com
Subject: Re: memory problems
Date: May 3 2002 2:44PM

In a message dated 5/3/02 10:33:30 AM Eastern Daylight Time, writes:

> Here are some tips that have helped me with similar situations:
> 1. I believe that the way to empty a hash is (%hash = ();)
> 2. Emptying the hash doesn't free the RAM, as far as I know. To free the 
> RAM, I think you need to (%hash = undef;)
> 3. If there's any possible way, I'd avoid loading up a bunch of blob data 
> items into memory and processing them. I process one blob at a time.
> 4. Disconnecting from Sybase probably will only free up the Sybase data 
> structures. This won't free up perl internal variables.

Neither will it help you return any memory to the system for other processes. 
 Once a process grabs memory from the heap, that memory belongs to the 
process until the process terminates.  This is true for Solaris and HP at 

To disconnect from Sybase you can always:
undef $dbh; #

But I would caution you that $dbh = undef may not do what you want, because 
it doesn't explicitly call the garbage collectors for the object.  Instead, 
it simply throws away the pointer to the object so that the object -- and its 
memory -- is no longer available.