I read about the following words in a paper of heap resizing in Poly/ML. But I didn't understand how exactly is the heap resized? Could anyone explain it in more detail?
At the end of every major GC(Garbage Collection), the adjustHeapSize() method is called. This method varies the heap size dynamically so there is a specific amount of free space available. That is to say, suppose the mature space contains l MB of live data immediately after a GC, then adjustHeapSize() varies the mature space size to K +l MB, where K is a precomputed constant amount. K is the value of the majorGCFree static variable in gc.cpp, which is set to the size of the mature space when the Poly/ML runtime commences execution.
I understand that there is a certain amount of free space available after each GC. But how to get the next calculated value for heap size? What is K and how is K computed? Why set it to K + l?
This is the old memory management mechanism and has been completely replaced in version 5.5. The paper you're quoting was some experimental work leading to the current version.
In the old version the initial heap size was set to the value given in the -H parameter which defaulted to half of the physical memory. Roughly, K was that size. The reason for setting the heap size to the sum of K and the size of the live data is that it means that after every GC there is K space free. The amount of free space roughly determines the time between each GC.
This is rather crude and the new version adjusts the heap size to keep the ratio of the GC time to mutator (application) time roughly constant, within upper and lower limits.