[Jprogramming] Readonly mapped file problem

John Randall randall at andromeda.rutgers.edu
Wed Nov 15 01:15:13 HKT 2006


I have some large mapped files.  When I open them read-only, I run out
of memory (I think).  Am I doing something wrong?

John


require 'jmf'
JDATA=:'/some/path/to/data/'
NB. c,r,m are files each containing
NB. a list of about 1e8 integers.

NB. Read/write access: do not run out of memory
   map_jmf_ 'c';(JDATA,'c')
   map_jmf_ 'r';(JDATA,'r')
   map_jmf_ 'm';(JDATA,'m')
   unmapall_jmf_ ''
0 0 0

In a new J session:

NB. Read-only access: run out of memory
   map_jmf_ 'c';(JDATA,'c');'';1
   map_jmf_ 'r';(JDATA,'r');'';1
|domain error: memw
|   (aa,~HS+fad-had)    memw had,0,2,JINT






More information about the Programming mailing list