Re: Binary data in multiple adjacent files



JF Mezei wrote:

I have a program that was setup to provide elevation data for all of
australia new zealand from 2 large datasets that covered that territory.
The application kpet the 2 files opened and did relative reads into
those binary files to obtain the required data (and cached those record
so that if the next request was for a nearby cell, it would save an IO).

Now however, updated data comes in much smaller files, each covering
only 1° lat by 1° long. Each file has 1201 * 1201 values, each value is
2 bytes. (basically elevation in metres for a 92 square metre area).
Each file is roughly 2.8 megs.

(This is degraded information due to the US government feeling it could
be used by terrorists, but it is still better than what was available
before. The SRTM data is precise to about 1 square metre, and some
sections have been released to 30 square metre accuracy, but most is at
92 metre).


Switching to this would mean that my application would need to open
hundreds of files to cover australia for instance, so this introduces
scalability issues. And since I need to review the code, I figured I
should perhaps consider other methods.

For my current needs, I need to cover from 45 to 47° north, and from
-73° to -76°, which gives me th following files:


N46W076 N46W075 N46W074
N45W076 N45W075 N46W074

N46W074 covers 46°N 74°W at the lower left corner to 47°N 73°W at the
upper right corner.


Looking at $CRMPSC, it appears I need to do a RMS $OPEN on each file and
provide the channel associated with each file.

So this would eat into the FILLM quota.

Now, if i just do the $CRMPSC to map a whole file to some virtual
address in my process space, would this consume 2,8 meg of working set
right away ? Or does VMS just allocate virual memory that is marked
invalid, and only when I try to access a few bytes at a location would
VMS load a single page from the actual file that contain those 2 bytes I
asked for ?


Virtual memory is just that! Things only need to occupy physical memory when you try to read or write them. Anything you are not using can be pushed out to make room for something else. So it won't necessarily eat your working set which is physical memory. There are also limits on virtual memory (PAGEFILEQUO) and a real constraint. The later is that performance will suck if if each memory reference is to a new page and you don't have a large working set.

The nature of my application means that as I follow a route, I read data
progressing in one direction, and the odds of having to go back are low
(but not nil). So, blocks containing elevation data read early on are unlikely to be needed again once I have moved on to points outside those blocks.

Does VMS provide a means where I can specify that I want at max 2 pages
from a global section to mapped to my working set at ay point in time ?
(this way, when I request a shortword located in a different block, the
system would automatically unmap the oldest block mapped to that file
and use that memory to map the new block to the file).

Not that I know of. Virtual memory is managed globally for your process. When you need a new page (you requested a page not in your working set) an old page gets pushed out to make room. The least recently used page will normally be the one pushed out.

<snip>
.



Relevant Pages

  • Re: Still confused why working set larger than virtual memory
    ... > when working set is larger than virtual memory? ... > I think in your below case, you mentioned the file map pages are not counted ... I can see very little memory reported as a working set ... I suppose file pages which are currently mapped into a view are counted as a part of both the working set and used virtual memory, however I did not perform any experiments in this sense. ...
    (microsoft.public.vc.language)
  • Re: Delphi 2007.1: another memory leak?
    ... we can select different types of memory: ... working set, peak working set, working set delta, private working set, ... Because of the Windows paging system, the physical memory usage may be low, ... because pages are swapped out to disk, but the virtual memory usage may be ...
    (borland.public.delphi.non-technical)
  • Re: [Lit.] Buffer overruns
    ... > floating point support or a memory expansion option. ... had virtual memory support grafted on. ... > where the modified instruction was fetched from. ... vis-a-vis the official coporate strategic operating system TSS/360. ...
    (sci.crypt)
  • Re: Still confused why working set larger than virtual memory
    ... With the SysInternals Process Explorer the column is called Working Set. ... What you removed is exactly the "smart trick" to have memory "accessible", ... as you map views you never unmap. ... I attach my test source which I used for my file mapping measurements. ...
    (microsoft.public.vc.language)
  • Re: scf /scannow & INFO in Event Viewer
    ... I know all about restore to ... pagefile to a low end of 2, ... The memory used by the user's ... Virtual Memory: Total paging file size for all drives is 2046MB ...
    (microsoft.public.windowsxp.general)