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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tough problem: Cannot allocate memory for a simple cp call!

Status
Not open for further replies.

svar

Programmer
Aug 12, 2001
349
GR
When running a perl script that has been running fine
for ages and still runs fine on other machines with the same HW(the difference being Suse and 2.6.11 vs
2.6.13 Slack 10.2 on the current machine that gives the problem) , a cp fails with return code 65535. More detailed diagnostics ($!) says 'Cannot allocate memory'

top did not complain about memory. I suspect the problem is
much more serious(after storing and deleting large
datastructures which is what the program does, I simply cannot believe it
lacks the memory for a cp!). It does not happen on other machines with less memory even(I have 2GB RAM here)

copy /home/myuser/AFILES/s7ermsc1.0.2.gz to /home/myuser/DFILES/s7ermsc1.0.2.av.gz from AFILES to DFILES failed with 65535.
Exclam point is Cannot allocate memory
child exited with value %d
not copied ( cp /home/myuser/AFILES/s7ermsc1.0.2.av.gz /home/myuser/DFILES/s7ermsc1.0.2.av.gz )

 
Have you checked for infinite symlink loops?

Does the command work when you run it from the command line as the same user-id that was used above?

Annihilannic.
 
It seems to me that it is the fork which failed (for example).

This could be related to the number processes you have running, or perhaps the total number of files open in the system. These limits are imposed by the kernel, which would track with why one distro works and the other doesn't. The limits are of course one of the many fiddle factors within the kernel.

Historically, this required editing some config files are rebuilding the kernel, but I've no idea about the current specifics for either of those distros.

This is of course an 'easy' fix for experienced kernel types who rebuild linux before breakfast on a daily basis :)

--
 
ok, which files do I need to rebuild?
I thought this was a ulimit issue....
 
They might be set using pam_limits.so, which on RHEL and SuSE reads /etc/security/limits.conf, not sure about Slackware.

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top