Showing results for 
Search instead for 
Did you mean: 

emalloc problem


emalloc problem

HI there,

I installed a SQL backup script -> it dumps the SQL database, tar.gzips it and then it emails it to me. The script that I used is the one from, and it works fine when I call it at i.e. it emails everything and it all works hunky-dory.
(Since it emails it to me, please don't run this script more times than necessary!! Dial-up sucks at downloading large emails! Wink )

I then decided that I should set this up as a cron job, so I did, and eventually I got the syntax correct earlier this week. When the script is run by the cron job, and also when I run it myself I get his feedback:
... {cropped}

15:14:54: Backup for database eaglecentre_f9 completed with 0 errors.
15:14:54: Diskspace used by MySQL database backup files: 745.2 KB
15:14:54: Backup completed with 0 errors.
Have a nice day!
15:14:54: Preparing file attachment SQLdbeaglecentre_f9.tar.gz
FATAL: emalloc(): Unable to allocate 929919 bytes

The command that I was using was
/usr/local/bin/php $HOME/admin/backup/db_backup.php
and I 've tried
php $HOME/admin/backup/db_backup.php
as well.

The permissions should be set up correctly too:
eaglecentre@cgi05 backup $ pwd

eaglecentre@cgi05 backup $ ls -l
total 292
-rwxr-xr-x 1 eaglecentre cgishell 6806 Mar 27 22:14 HISTORY
-rwxr-xr-x 1 eaglecentre cgishell 12655 Mar 27 22:14 INSTALL
-rwxr-xr-x 1 eaglecentre cgishell 18351 Mar 27 22:14 LICENSE
-rwxr-xr-x 1 eaglecentre cgishell 31332 Mar 27 22:14 PEAR.php
-rwxr-xr-x 1 eaglecentre cgishell 3725 Mar 27 22:14 README
-rwxr-xr-x 1 eaglecentre cgishell 114 Mar 27 22:14 TODO
-rwxr-xr-x 1 eaglecentre cgishell 56684 Mar 27 22:14 Tar.php
-rwxr-xr-x 1 eaglecentre cgishell 29683 Mar 27 22:13
-rwxr-xr-x 1 eaglecentre cgishell 20818 Mar 27 22:13
-rwxr-xr-x 1 eaglecentre cgishell 11406 Mar 27 22:13
-rwxr-xr-x 1 eaglecentre cgishell 9998 Mar 27 22:13
-rwxr-xr-x 1 eaglecentre cgishell 5753 Apr 15 11:17
-rwxr-xr-x 1 eaglecentre cgishell 28738 Mar 27 22:14 db_backup.php
-rwxr-xr-x 1 eaglecentre cgishell 27416 Mar 27 22:14 functions.php

Is there some form of (memory?) restriction with using the cgi shell (via SSH), as opposed to using the web servers themselves -> Perhaps I could be running out of ram or swap whilst running the script?
I tried to run top to see whether I could monitor the usage in the background, but that didn't work (top refused to load with error:
kvm_open: short read

top: kvm_read for _ccpu: Unknown error: 0

Comments, suggestions?


emalloc problem

I've just realised that I set up some basic security on the database backup script tool!!!! Shockedops:
So, that would mean that none of you can access the file to test it.

I've just been playing with the script, and got this error to pop out:
[18-Apr-2004 23:23:18] PHP Fatal error:  Allowed memory size of 8388608 bytes ex

hausted (tried to allocate 1929926 bytes) in /files/home/eaglecentre/admin/backu
p/ on line 220

Now, also when running the script through the web server, the page just stops mid-way. :/
(the database upped in size by around 400K since Saturday, so this might be related)

Is there a memory limit on the scipts?
(8 meg should be enough, but I've contacted the author to see whether he can think of a few ways to free up some variables or two!)

(perhaps this is related to

emalloc problem

problem has been fixed by the size being altered to 16 meg.