Is there a Java third party library that provides a collection that compresses its constituent objects? I googled for it but came up blank. Wouldn’t such a construct be useful for large (read multi-gig) maps, or some such thing? Sure there’s a performance penalty with access and storage, but for long lived infrequently accessed references, it seems reasonable, no?
Is there a Java third party library that provides a collection that compresses its
Share
The use cases for this are essentially use cases for in-memory databases, so you should probably look into those.
If you were to do this, you’d probably have to basically serialize arbitrary java objects into bytes, then Reflect them back into the classes. May as well use an in-memory database – there’s no real difference that I can see anyway, other than that java is probably a bit high-level for that kind of thing.
Note that this is actually somewhat java-specific – it might be that in C you could have a library which would grab the memory and just compress it without having to do any fancy stuff, but since Java doesn’t have access to memory it makes that kind of thing a bit hard…