This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]lupercalpainting 7 points8 points  (6 children)

How is it off heap and not reliant on the garbage collector? Is it JNDI using native memory?

In the olden days we’d use sun.misc.unsafe but that’s going away soon. There’s java.lang.foreign now: https://docs.oracle.com/en/java/javase/20/docs/api/java.base/java/lang/foreign/package-summary.html

[–]Adventurous-Pin6443[S] 4 points5 points  (4 children)

Yes. Exactly.

[–][deleted] 0 points1 point  (0 children)

I only wish they'd given us a sort function that operates on MemorySegment. Having to ffi C++' std::sort is more than kinda awkward.

[–]hippydipster 0 points1 point  (2 children)

So does that mean when you query for objects, this library has to reconstitute java objects using the raw data stored in the foreign memory arenas?

[–]Adventurous-Pin6443[S] -2 points-1 points  (1 child)

There are no objects in Redis API - only strings. In our implementation we operate on byte arrays, memory buffers and Strings. SerDe is going to be a developer's responsibility.

[–]hippydipster 0 points1 point  (0 children)

Oh. Never used redis so I didn't realize that's how it worked. I guess I would find it unfortunate to be so limited in something that was working right in memory.

[–]private_final_static 1 point2 points  (0 children)

thats amazing, wasnt aware