> How, pray tell, did you find out the exact line the mud's 
> hanging on? GDB's
> good, but as far as I know it's not that good.. A backtrace 
> will get you
> into the general area of where your mud went bad, but still.

Backtraces are good for core dumps, but not as useful when the mud is
actually running.
Since his mud is running he should step through it.

If you step through a program, and the program pauses on one line, GDB will
pause too.

> What do levels have to do with memory? Umm, not much at all, 
> in fact I'd say
> next to nothing.. I've increased ML quite a bit more than 206 
> and I get no
> extra memory usage, etc... So, please, do elaborate as to how 
> you got to
> this conclusion, because 10:1 it's wrong.

Well, he's not running out of memory, but in this case, his assumption that
MAX_LEVEL affects memory usage is correct.
He is creating an array based on MAX_LEVEL.
The size of the array, thus the amount of memory it uses, is determined by
MAX_LEVEL.

char skill_list[LEVEL_HERO][MAX_STRING_LENGTH];

If MAX_LEVEL is 412 it takes up exactly twice as much memory as if it was
206.


I would highly recommend tracing the program with GDB to find out where your
'hang' is.

Reply via email to