Re: I ran out of memory
by waswas-fng (Curate) on Aug 26, 2004 at 16:52 UTC
|
This usually can mean your app's data has grown over time and is now taking more memory than you have in real and swap. The other thing that can be happening is maybe there is another app of the server that has now grown to a large size and is taking most of the system memory. try using tools like top, ps, free or whatever is available on the operating system you are running on to see where the hog is.
| [reply] |
|
Okay so first of all, the website is stored on a server that I don't own, so I can't run such commands.
The data the program uses is stored in a DBM database, and it's only the beginning so it's quite small really.
I've used the following memory test script I got from a certain website. It tries to use about 8MB of memory. It fails to do so:
#!/usr/bin/perl
$| = 1;
print "Content-type: text/html\n\n";
print "Memory/Resource Test<BR>\n";
print "Number is the amount of memory used<BR>\n";
print "If you don't see 'Completed Test!' at the bottom, the test fail
+ed<P><HR>\n";
for ($i = 10000; $i <= 8000000; $i += 100000) {
$x = " " x $i;
print "-";
print "| $i ; Time (secs): ", (time - $^T), "<BR>\n" if $i % 1
+000000 == 0;
}
print "Completed Test!\n";
exit(0);
So I guess my host limits the ammount of memory my CGI programs can use...
-------------------------
Live fat, die young
| [reply] [d/l] |
|
You can probably request a higher limit for an additional fee. Talk to your hosting provider for more info.
------
We are the carpenters and bricklayers of the Information Age.
Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose
I shouldn't have to say this, but any code, unless otherwise stated, is untested
| [reply] |
|
|
Re: I ran out of memory
by davido (Cardinal) on Aug 26, 2004 at 16:59 UTC
|
| [reply] |
|
| [reply] |
|
| [reply] [d/l] |
|
Re: I ran out of memory
by ikegami (Patriarch) on Aug 26, 2004 at 16:53 UTC
|
What does the code do? Can we see it? | [reply] |
|
| [reply] |
Re: I ran out of memory
by Anonymous Monk on Aug 27, 2004 at 09:57 UTC
|
Out of memory means that the combined memory usage of all the processes on the system (or in some group with separate limits) have reached the limits, and that your process did a request that would push the total usage over the limit - and hence the request got denied. Your process decided to throw up its hands in the air and give up (die). This is what a lot of processes do. Without knowing anything about your program, it's impossible to determine whether your program is using more memory than it should, or that it's just an innocent victim of another process hunger for resources.
Perhaps you need to buy more memory. Perhaps you need to redesign your program. Perhaps you need a different database. Perhaps you need to purge old data. Perhaps you need to kill another process. Perhaps you have a virus. Who could tell? | [reply] |
|
| [reply] [d/l] |
Re: I ran out of memory
by bronto (Priest) on Aug 27, 2004 at 08:08 UTC
|
You forgot to tell us which webserver you are using and if you are using mod_perl.
Unless you did something really wrong, CGIs shouldn't be a problem, since they die and free the memory they were using after execution
If you are using Apache and mod_perl you should try Apache::SizeLimit to shoot apache instances that grew too big. If not... good luck ;-) the question is unanswerable without the code
Ciao! --bronto
The very nature of Perl to be like natural language--inconsistant and full of dwim and special cases--makes it impossible to know it all without simply memorizing the documentation (which is not complete or totally correct anyway).
--John M. Dlugosz
| [reply] |