[Jprogramming] Out of Memory
Don Guinn
donguinn at pvtn.net
Fri Mar 23 23:48:15 HKT 2007
Unfortunately in this case there were no variables to erase. When I said
"memory leak" I was not meaning a memory leak losing memory to Windows, I
meant that for some reason the storage allocated via J's memory management
is not returned to J's memory management.
On 3/23/07, Devon McCormick <devonmcc at gmail.com> wrote:
>
> Don -
>
> I've run into this sort of situation before. Sometimes erasing extraneous
> variables
> helps but often it is just easier to restart the session. I'm not
> familiar
> with the
> underlying causes but it seems to happen when creation of a large array
> runs
> out of memory, as you said.
>
> Devon
>
> On 3/23/07, Don Guinn <donguinn at pvtn.net> wrote:
> >
> > What follows is the entire contents of a J session which ran out of
> > memory.
> > This is on a 1G machine on Windows XP Pro.
> >
> > I was playing with one of the Project Euler problems and wanted to
> verify
> > the answer using rationals instead of floats. The solution using floats
> > ran
> > in about a second. When I converted it to use rationals it went to
> paging
> > and eventually ran out of memory. Fair enough. This is a pretty memory
> > intensive approach.
> >
> > The problem is that once it ran out of memory nothing of any consequence
> > worked. Even clicking File/Exit got out of memory. Fortunately 7!:3''
> > worked, but it took a long time to run as it had to go through a lot of
> > memory that was paged.
> >
> > The thing is that there should be plenty of memory available as nothing
> > beyond the standard libraries were loaded. Is there a memory leak
> > somewhere?
> > Is it possible that when an out of memory occurs that J forgets to free
> up
> > memory? This is on j601/2006-11-17/17:05
> >
> > x:(x:^:_1]3r7)(_2:{[:(/:~)[:~.]%~[:<.*)>:i.100000
> > 42857r100000
> > x:(x:^:_1]3r7)(_2:{[:(/:~)[:~.]%~[:<.*)>:i.1000000
> > 428570r999997
> > x:(x:^:_1]3r7)(_2:{[:(/:~)[:~.]%~[:<.*)>: i.1000000
> > 428570r999997
> > 3r7(_2:{[:(/:~)[:~.]%~[:<.*)>:i.1000000
> > |out of memory
> > | (_2:{[:(/:~)[:~.]%~[:<.*)>:i.1000000
> > x:(x:^:_1]3r7)(_2:{[:(/:~)[:~.]%~[:<.*)>:i.1000000
> > |out of memory
> > | x:(x:^:_1]3r7) (_2:{[:(/:~)[:~.]%~[:<.*)>:i.1000000
> >
> > |out of memory: wdhandler_0_
> > | wdq=: wd'q'
> >
> > |out of memory: wdhandler_0_
> > | wdq=: wd'q'
> >
> > |out of memory: wdhandler_0_
> > | wdq=: wd'q'
> >
> > |out of memory: wdhandler_0_
> > | wdq=: wd'q'
> >
> > |out of memory: wdhandler_0_
> > | wdq=: wd'q'
> > 7!:3''
> > 64 29644938
> > 128 1293
> > 256 342
> > 512 270
> > 1024 84
> >
> > |out of memory: wdhandler_0_
> > | wdq=: wd'q'
> >
> > -------At this point after I copied the session to the clipboard for
> > pasting
> > into this message I entered 2!:55'' and ended the session.
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> >
>
>
>
> --
> Devon McCormick, CFA
> ^me^ at acm.
> org is my
> preferred e-mail
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
>
More information about the Programming
mailing list