Re: Kernel is quitting on me
- To: mathgroup at smc.vnet.net
- Subject: [mg97913] Re: [mg97851] Kernel is quitting on me
- From: Fernando Cucchietti <fernando.cucchietti at icfo.es>
- Date: Wed, 25 Mar 2009 05:45:43 -0500 (EST)
- References: <firstname.lastname@example.org> <200903230903.EAA27073@smc.vnet.net> <200903241028.FAA19615@smc.vnet.net> <C51BCA18-5E5C-4F34-B23A-F928705DAB7A@jeol.com>
yours was a very useful answer. I was also afraid that there could be
a memory leak somewhere. However, I don't know how to track down the
offending code. Any ideas?
I Remove-d all variables from my modules (which were all properly
defined as local anyway), except the one that gets returned as the
output of the module. How could I do that? There are also "hidden"
variables created inside each Module when computations are made, I
guess I have to pray for those to be disposed of.
Do you think that renaming all variables from all modules so that
there are no two variables named the same could help? I mean, even if
they are local to the module, could they collide and cause the leak?
On Mar 24, 2009, at 2:17 PM, Sseziwa Mukasa wrote:
> On Mar 24, 2009, at 6:28 AM, Fernando Cucchietti wrote:
>> Hi all,
>> I am testing a very long worksheet, and all the pieces seem to be
>> working (separately). When I use the loop that puts them all
>> the kernel quits after a few seconds (or at least, the equivalent of
>> the kernel quitting: everything goes undefined and in a weird color).
>> I've tried following the computation step by step and everything
>> normal until it just hangs. Also it seems to hang at different places
>> everytime, but that *could* be that I am testing with a different
>> random initial condition every time.
>> I=B4ve checked if it is memory usage, it shouldn't be since the
>> MaxMemoryUsed never goes above 15MB. I tried with $HistoryLength=0
>> just in case. The kernel in Debugger mode also just quits.
>> There is almost no symbolic manipulation either, just operations on
>> lists with numeric values.
>> I can't reproduce the error with simpler algorithms, and submitting
>> the whole worksheet for other to find a bug seems too much.
>> My question is then: What kind of things can cause this behavior?? I
>> have really no clue since there are no error or warning messages,
>> an ugly quit. I would appreciate at any pointers to where can I start
>> looking at...
> I suspect you have a memory leak in a Module. I know Mathematica is =
> supposed to be garbage collected but in my experience I have found
> routines that leak, my recommendation is to use Remove on any
> variables created in modules. I don't know what kind of code you
> are writing but I have also been able to cause some Mathematica
> routines to crash on input that doesn't seem particularly special,
> in particular I've seen SingularValueDecomposition fail on seemingly =
> innocuous numeric input.
> Hope this helps,
Prev by Date:
Re: Histograms and Iterators - Beginner Question
Next by Date:
Re: Unexpected behavior of Floor and IntegerPart
Previous by thread:
Re: Kernel is quitting on me
Next by thread:
Re: Re: Kernel is quitting on me