Foreign memory access with classes
Johannes Lichtenberger
lichtenberger.johannes at gmail.com
Tue Nov 8 14:42:37 UTC 2022
>
> Different applications might have different requirements re. how much GC
> allocation is considered "acceptable". In principle you can create a single
> big memory segment for each "page" and just peek and poke at memory through
> it, never materializing a single instance. If you do that, GC overhead will
> be fairly low (if any).
>
That's not possible, IMHO. Initially, the pages, once instantiated, are
"empty", thus no nodes/records are stored. Thus we'd need a growable
MemorySegment somehow.
That said, the records/nodes themselves are causing GC pressure, as there
are up to 1024 records per page. Thus, many objects are created (the pages
themselves "only" have a 1/1024 ratio). It would be awesome to define a
point where all the memory used by those objects on the heap magically
disappears (as after serializing the objects and then the pages and
clearing the in-memory map, they are not referenced anymore).
Thus, my idea was to provide small-sized MemorySegments for the records
themselves, but I might have the same problem, that a MemorySegment has a
fixed size / spacial bound.
I think a queue as e.g. Chronicle Queue doesn't have this problem, because
they do not accumulate data in-memory, but they merely write into the
underlying memory mapped file directly.
In my day to day job I'm working on other stuff, so it might well be, that
I'm missing something completely ;-)
Kind regards
Johannes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/panama-dev/attachments/20221108/71b9907d/attachment-0001.htm>
More information about the panama-dev
mailing list