I am using the +hmax
command line option to set the default maximum heap size for processes. For some time after I increased the limit I noticed that the options seemed to have no effect. Now I think I found why. It looks that the max heap size is stored as a 30-bit signed integer value. If I start the system with
+hmax 536870912
then using process_info for any process to find effective limit shows negative number
{max_heap_size,#{error_logger => true,kill => true, size => -536870912}}
For 536870911 it works correctly. The same behaviour can be observed when erlang:system_flag(max_heap_size, Size)
is used to set the max size. But setting the max size for an individual process with process_flag(max_heap_size, Size)
does not have this limitation.
I could not find any documentation describing this. Is it intentional? If not, can it be fixed?