MOO-cows Mailing List Archive


Re: Big strings => panic

>How's it worse, for my knowledge? :)
>I think killing the task that's causing the panic, thus freeing the memory
>it was using, would solve the problem... no need to panic any more if
>you're no longer running out of memory.

This is a great idea and all, but if all the memory on your system is used,
including virtual memory, by one process, that means the rest of the machine
is still in jeopardy.  When you call free(), the memory is only reclaimed
for the process, not for the rest of the processes on the machine.  This is
why you never see your memory usage go down -- it always grows and never
shrinks.  The only way to make the entire system safe in a case such as that
is to wipe the process from memory by killing it.  Thankfully, the MOO
server catches those kinds of errors and tries to save the state of the db
before the process is removed.  To put it another way, if I malloc 32 megs,
my process size grows by 32 megs.  Once I free that, it will be used by
another call to malloc, but the process size stays the same.  And if a call
eats of all the virtual memory also, the problem is even bigger.  Some would
consider this to be a problem with the design of the OS...


Home | Subject Index | Thread Index