Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

system slowing down

Status
Not open for further replies.

nyck

Technical User
Mar 10, 2004
447
GB
I have got a user who is running a perl script on an AIX5.2 server, the script will run for a while until it crashes with an Out of Memory error. There is nothing be logged into errpt, the swap space size does not change. The only thing that seems to happen is that the %idle in sar drops very low, such as 5-10 and the machines runs like a dog.

Any advice on what i can do?

I have asked the user to debug their script just in case that is the problem.
 
Sounds like the script has a memory leak, or is simply trying to create data structures that are larger than perl's memory management can handle. The sudden drop in idle time right before it dies would be due to the perl interpreter's garbage collection frantically trying to find some memory to free.

The perl interpreter itself has a memory limit, which is compiled into the executable. This is the memory that ran out if the script ended by printing "Out of Memory!" to stderr.

That last time I ran into this, and I can't remember if it was on 5.1 or 4.3.3 or which version of perl, the limit was roughly 100 megabytes.

If the script isn't creating really huge structures in memory, then it's probably a memory leak. For a leak, the user should look for circular references or self references in the script or any modules it loads.


- Rod

IBM Certified Advanced Technical Expert pSeries and AIX 5L
CompTIA Linux+
CompTIA Security+

A Simple Code for Posting on the Web
 
The user is telling me that the server seems to have a limitation of 2Gb for the use of memory per processs.

Could this still be a leak?
 
I'm not talking about the server's per process limit, I'm talking about the perl interpreter's limit as defined when it was built.

That said, no matter what the limit, it would take an understanding of the script itself and what its memory use should be to know whether it's a leak. When you say the script "will run for a while", what's a while? Also, what is the general purpose of the script (server, client, batch process, etc...)?

- Rod


IBM Certified Advanced Technical Expert pSeries and AIX 5L
CompTIA Linux+
CompTIA Security+

A Simple Code for Posting on the Web
 
try using trace command while you run the script! it will tell you exactly what is happening.

man trace for more info

Regards,
Khalid
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top