I will answer in pieces over several msgs.

The space reported by the Windows Task Manager includes:

- The code space for j.exe and j.dll as well as their stack space.  
See http://www.jsoftware.com/help/release/recurlim.htm 
for what "stack" means.
- The space used by the portions of memory mapped files
that are in use.
- Any space that has been malloc()-ed but not yet free()d.

Everything in J is an "array", an object of type A
(as in http://www.jsoftware.com/jwiki/Essays/Incunabulum
but extended).  Type A has a field that indicates how many 
bytes it contains.  7!:5 <'x'  traverses x , adding up the bytes 
for each part that is a type A object and returning the
total as the result.  For example, if x=: i.12 then
there is just one number going into the sum, but
if x=: 1 2;~;:'Cogito, ergo sum.'  then the sum is
made up of 7 numbers. 

7!:6 <'x' does the same for locale the locale named x .



----- Original Message -----
From: "Sherlock, Ric" <[EMAIL PROTECTED]>
Date: Tuesday, July 29, 2008 21:30
Subject: [Jgeneral] Space foreign conjunctions
To: General forum <[email protected]>

> I'm trying to understand how the various 7!:n foreign 
> conjunctions relate to each other and to the memory use reported 
> by Windows Task Manager. I apologise in advance if any of the 
> questions below illustrate my meagre understanding of memory usage.
> 
> >From the Dictionary (help/dictionary/dx007.htm)
> 7!:0 Current. Space currently in use.
> 7!:3 Free Space. ... 2-column table of the block sizes and 
> number of free blocks for each size.
> 7!:6 Locale Space. The space in bytes used by the locales named 
> in y , including the space for the names as well as values in 
> the locale, locale name, path, hash table, and global symbol 
> table entries.
> 
> My understanding from reading through the posts linked here:
> http://www.jsoftware.com/jwiki/Guides/General_FAQ/How_does_J_manage_memory%3F
> 
> ..is that the space described by 7!:3 is allocated to and 
> managed by J (not available to the operating system), but not 
> currently "used" by J.
> 
> A) Is Free Space included in, or on top of Current space ?
> 
>    ]LocSpc=: +/ 7!:6 conl ''
> 1218784
>    ]FreeBlks=: 7!:3 ''
>   64 1411
>  128  602
>  256  303
>  512  109
> 1024   21
>    ]FreeSpc=: +/ */"1 FreeBlks
> 322240
>    ]InuseSpc=: 7!:0 ''
> 1465472
> 
>    InuseSpc-LocSpc+FreeSpc
> _75552
> ...suggests that it is on top of 7!:0 '',
> 
> B) Assuming Free Space is on top of Current Space, what else is 
> included in Current Space apart from Locale Space?
> 
>    InuseSpc-LocSpc
> 246688
> 
> Again assuming that FreeSpc is on top of InuseSpc, total space 
> allocated to J in kilobytes is:
>    1024%~ InuseSpc+FreeSpc
> 1745.8125
> Windows Task Manager reports 3,800 K in use.
> 
> C) Is the difference between Current Space + Free Space and what 
> the Task Manager reports due to (from Dec 2001 forum post) 
> "interpreter memory use including things like primitives and 
> locales (symbol tables and namespaces)" ?
> 
> 7!:1 Session. Total space used since start of session.
> 
> D) Is Session Space equal to Current space + all space allocated 
> and then freed since the start of session?
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to