I'm trying to find a memory bug where all of a sudden my program freezes 
and eats up all the memory.
I tried to do some printing, and tried to understand which line of code is 
responsible for causing the memory leak to happen.
The print statement looks like this:

println("computing cost for...", fact.f_name, " ", dom)

where "fact" is an object with a name, "f_name", which is a string, and 
"dom" is simply a list of tuple of numbers.
Usually, this line of code will output something like this in the console:

computing cost for...f_inte1 [(7.2109375,7.21875)]

Indicating that it is about to start computing the cost for the fact 
object. However, when this memory bug occurs, it only prints this:

computing cost for...^CERROR: interrupt

It does not give me the name of "fact" before the bug happens, nor does it 
attempt to print out the "dom". It doesn't even give me a stack trace!


I am very clueless on what could be happening. So here is my 3 questions:
1) What could cause a print statement to not finish printing? the fact 
objects are all already allocated, and all with a valid f_name field.
2) If there is some memory error where I am forced to ^C before my computer 
freezes, how can I recover a call-stack?
the answer here I think... is I am using the @profile macro so something 
happened that prevented the call-stack from showing.

3) Is there some way of knowing which part of the program is consuming most 
of the memory at the time of the bug? I tried using 
"--track-allocation=all", but I do not care about memories that are already 
re-claimed by the garbage collector, but I do care about memory yet to be 
claimed at the time of the error.

Sorry for the long post...
--evan

Reply via email to