SoftMaxHeapSize has no effect with Cassandra
Kornel Pal
kornelpal at gmail.com
Thu Jan 14 21:40:32 UTC 2021
Hi,
Kornel Pal wrote:
> Is it possible that the initial ShenandoahSoftMaxHeapSize value is never set for the heap? I could only find it being set on run-time value changes (JDK8), but there was no such run-time change logged.
I think I was able to figure out what is happening; soft max heap size is silently changed to min heap size in check_soft_max_changed(), when soft max heap size is less than min heap size. Cassandra on the other hand is setting min and max heap size to be the same by default, that results in soft max heap size to be ignored without any warning being logged.
My understanding is that min heap size is used for uncommitting memory, while soft max heap size is use for collecting garbage, so I would not expect the two to depend on each other this way.
This is the only dependency I could find (in ShenandoahControlThread::run()):
size_t shrink_until = soft_max_changed ?
heap->soft_max_capacity() :
heap->min_capacity();
I am however not sure whether that is needed, because no other cases seem to use soft_max_capacity() for uncommitting memory, even subsequent iterations are reverting to min_capacity(), so soft_max_capacity() is used only right after it was changed.
Thank you,
Kornel
More information about the shenandoah-dev
mailing list