Hi Maciej, If I understand correctly, you're asking whether ValueState parameterized with Object has the same size as the one with Integer (given that the actual stored objects (integers) are the same). With RocksDB, any state object is serialized first and only then it is stored in MemTable or in an SST file. So it doesn't matter as long as the same serializer is used.
You probably should try enabling compression if you didn't already: https://ci.apache.org/projects/flink/flink-docs-stable/ops/state/large_state_tuning.html#compression Regards, Roman On Tue, Feb 23, 2021 at 12:40 PM Maciej Obuchowski < obuchowski.mac...@gmail.com> wrote: > Hey. > > We have deduplication job that has a large amount of keyed ValueState. We > want to decrease state size as much as possible, so we're using > ValueState<Object> as it's smallest possible Java non-primitive. However, > as per https://www.baeldung.com/java-size-of-object (and my measurements) > Java Integer has the same memory size as Object due to padding. > Will this still be true with RocksDB state? Can we put Integer in state > without increasing state size? > > Thanks, Maciej >