Howto configure maximum oldSpace size

Basic knowledge about the VM memory

When the VM starts, it allocates a certain amount of memory, which is called the “arena”. This is the total amount the virtual machine will ever use. The default value for the arena is 100MB. The arena is split into various sections that will be used to manage the Smalltalk objects. The most important and largest part is called the “old space”. This part will contain all objects living for a certain time. If the “old space” is full you will receive the message: “out of memory – unable to continue”. The default size for oldSpace is 72MB. If your application is using a lot of memory, you should increase the “old space”.

Unfortunately this configuration section is part of the V.EXE. So it cannot be adjusted dynamically (depending on available memory).

Configuring “old space”

[codesyntax lang=”smalltalk”]

| y x path |
x := 256. " new total arena size in MB) "
path := (Disk drive printString,':', Disk pathName,'\v.exe').
" Get VirtualMachineConfiguration from an image file: "
y := VirtualMachineConfiguration fromFile: path.
y arenaBytes: (x * 1024 * 1024 ).
y oldSpaceBytes: ((x - 28) * 1024 * 1024).
" Write VirtualMachineConfiguration to an image file: "
y toFile: path.

[/codesyntax]