J/APL memory use [was Re: SV: Space efficient sorting of 
Author Message
 J/APL memory use [was Re: SV: Space efficient sorting of

Devon McCormick writes on Friday, December 7:

Quote:
> (J, on the other hand, appears to grab increasing
> amounts of virtual memory as it needs to and is
> not so good about releasing it: sometimes, when
> working with large arrays, I find I must save my
> work and restart J in order to continue.)

If you can get a reproducible example of this,
I would appreciate your forwarding that to us.

All memory allocated by the interpreter is used
in one of the following cases:

a. Primitives and other system constants.
b. The pool allocations as reported by 7!:3 ''
c. A named object (noun, verb, adverb, or conjunction).
d. A locale and names assigned therein.
e. Memory temporarily in use while executing a line.

Any other memory use constitutes an error!
There are no known such other use; i.e. J has
no known memory leaks.  One way to test this is:

   7!:0 ''      NB. memory currently in use
604352
   +/ i.1e6     NB. or some other phrase
5e11
   7!:0 ''      NB. should be the same as above
604352

   7!:0 ''
604352
   x=: i.1e6
   7!:0 ''      NB. permanent object x was created
4798720
   4!:55 ;:'x'  NB. erase x
1
   7!:0 ''      NB. space should be recovered
604352

The number reported by 7!:0 '', space currently in use,
should be the same before and after executing an expression
that doesn't create a permanent object.

p.s. It is easy to have some names assigned in
a locale somewhere that you have forgotten.



Wed, 26 May 2004 11:52:59 GMT  
 J/APL memory use [was Re: SV: Space efficient sorting of
Just to clarify; does this mean that the J memory usage "expands and
shrinks" upon need, when looking at it from the "whole Windows memory
capacity" view? I.e., deleting a 10 MB variable in J releases 10 MB to be
used by other Windows applications?

About releasing memory; i create a number of Windows objects like pens,
brushes, fonts with WinAPI, and ImageLists, ToolControls etc. with Dyalog
APL's own functions. Even though i in my own opinion delete everything and
free up all allocated resources, there seems to be a memory leak somewhere,
which a haven't found. Sometimes, after having started the APL programs 10's
of times, i simply have to restart Windows because of odd behaviour here and
there. I somehow suspect that the problem resides within the interpreter and
it's management of ImageLists, ToolButtons with pictures, ListViews etc.
/ Tomas

----- Ursprungligt meddelande -----

Diskussionsgrupper: comp.lang.apl
Skickat: den 8 december 2001 05:52
?mne: Re: J/APL memory use [was Re: SV: Space efficient sorting of

Quote:
> Devon McCormick writes on Friday, December 7:

> > (J, on the other hand, appears to grab increasing
> > amounts of virtual memory as it needs to and is
> > not so good about releasing it: sometimes, when
> > working with large arrays, I find I must save my
> > work and restart J in order to continue.)

> If you can get a reproducible example of this,
> I would appreciate your forwarding that to us.

> All memory allocated by the interpreter is used
> in one of the following cases:

> a. Primitives and other system constants.
> b. The pool allocations as reported by 7!:3 ''
> c. A named object (noun, verb, adverb, or conjunction).
> d. A locale and names assigned therein.
> e. Memory temporarily in use while executing a line.

> Any other memory use constitutes an error!
> There are no known such other use; i.e. J has
> no known memory leaks.  One way to test this is:

>    7!:0 ''      NB. memory currently in use
> 604352
>    +/ i.1e6     NB. or some other phrase
> 5e11
>    7!:0 ''      NB. should be the same as above
> 604352

>    7!:0 ''
> 604352
>    x=: i.1e6
>    7!:0 ''      NB. permanent object x was created
> 4798720
>    4!:55 ;:'x'  NB. erase x
> 1
>    7!:0 ''      NB. space should be recovered
> 604352

> The number reported by 7!:0 '', space currently in use,
> should be the same before and after executing an expression
> that doesn't create a permanent object.

> p.s. It is easy to have some names assigned in
> a locale somewhere that you have forgotten.



Wed, 26 May 2004 21:33:14 GMT  
 J/APL memory use [was Re: SV: Space efficient sorting of

Quote:
> Perhaps someone versed in Dyalog internals could
> better explain this but I'm basing my theory on
> observed behavior of the system.  To whit, I have
> some background processes written in Dyalog that
> start at system startup and stay up while I'm
> logged in.  Even though I run with 65M workspaces,
> the (Windows NT) Task Manager shows the dyalogrt.exe
> for these processes consuming only 5 or 6 M.

If you add the column "VM Size" to the list of the ones displayed by
your task manager, you'll see that Dyalog APL has fully allocated the
memory for the workspace, but, since most of the pages haven't been
touched yet, the OS has delayed the actual use of the space. This means
that you won't be able to start as many Dyalog APLs as you want, because
eventually the OS will refuse to allocate more space than what's
available in the swap file, but your disk won't start trashing
immediately because of swapping since the memory is not actually in use
but only marked as "occupied".

--

Homepage: http://come.to/wildheart/

<<<All I Ever Learned, I Learned From Anime: ---
   EVERYTHING can explode.>>>



Wed, 26 May 2004 23:31:40 GMT  
 J/APL memory use [was Re: SV: Space efficient sorting of

Quote:

[snip]
> available in the swap file, but your disk won't start trashing
> immediately because of swapping since the memory is not actually in use
> but only marked as "occupied".

Stefano, the picture of your disk `trashing' is just to horrible to contemplate...
;-)


Wed, 26 May 2004 23:45:16 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. J/APL memory use [was Re: SV: Space efficient sorting of arrays]

2. Space efficient sorting of arrays

3. Space efficient sorting of arrays

4. JS-EAI with *JS*-callback

5. js.exception 3279.js

6. used space 0, free space 0

7. space-efficient top-N algorithm

8. re efficient sorting of arrays

9. Anybody know a fast efficient sorting Algorithm

10. GC efficient sort

11. Looking for an APL efficient frontier program

12. examples using JS to control vrml 2.0 wrls?

 

 
Powered by phpBB® Forum Software