Re: "Virtual memory" framework for Java



zeus wrote:
> Thomas Hawtin wrote:
>> zeus wrote:
>>> I am dealing with very large in-memory data structures. The
>>> data structures are accessed in different frequencies varying
>>> between every 30 seconds and few minutes. My first try was to zip
>>> the information to a file when un-needed, but it caused very high
>>> I/O wait on Solaris machine. What I really want is something like
>>> virtual memory - I want to be oblivious to where portions of the
>>> data structure are stored (in-memory or on disk) whenever I need to
>>> access the data, I want it to be loaded into memory.
>>> Do you know of such a framework for "virtual memory" in Java?
>>
>> Use java.nio to memory map a file.
>>
>> Be careful what you map though. If the file goes away or truncates
>> you can get an asynchronous exception (InternalError), and on Linux
>> the JVM actually crashes.
>>
>> Tom Hawtin
>> --
>> Unemployed English Java programmer
>> http://jroller.com/page/tackline/
>
> Can you elaborate a little bit about the utilization of the memory
> mapped file for virtual memory as I described?

Does
http://java.sun.com/j2se/1.4.2/docs/api/java/nio/MappedByteBuffer.html
help?
--
Virgil


.



Relevant Pages

  • Re: "Virtual memory" framework for Java
    ... Thomas Hawtin wrote: ... >> I am dealing with very large in-memory data structures. ... What I really want is something like virtual memory - I want ...
    (comp.lang.java.programmer)
  • Re: performance and memory usage.
    ... You're still ignoring the overhead for memory ... allocation data structures. ... Dynamic memory management is not magical in C. ... purpose hash table written in C. ...
    (comp.lang.java.programmer)
  • Assigning data structures to certain memory locations during porting
    ... I'm new to embedded programming. ... I'm trying to dynamically allocate data structures and uniquely map ... target machine with a scratch pad, a DRAM, and a Flash Memory. ...
    (comp.arch.embedded)
  • Re: Newbie completely confused
    ... Your program uses quite a bit of memory. ... And really, reading 30MB files should not be such a problem, right? ... 'del LINES' deletes the lines that are read from the file, but not all of your data structures that you created out of them. ... The python code loads a module written in C++ and some of the member variables actually point to C++ objects created dynamically, so one actually has to call their destructors before unbinding the python var. ...
    (comp.lang.python)
  • Re: The Hoard Scalable Memory Allocator
    ... functioning of your program whether objects (and data structures) ... then memory ... outside that niche, then garbage collection is often not worth it. ...
    (comp.programming.threads)