Wiki source for sqMemoryExtraBytesLeft
======**sqInt sqMemoryExtraBytesLeft(sqInt includingSwap)**======
**Parms**:
includingSwap If true use swap space in calculation
**return**: bytes allocated for squeak oops space, but not used
**From**: Interpreter
**Why**:
To give indication how much more the image could grow.
**Responsibility**:
This is very windows centric, it returns bytes left of allocated but not used space.
But on BSD systems we don't know or care about swap space size.
**MacIntosh**
//os-9/OSXCarbon//
return gMaxHeapSize - gHeapSize;
//Cocoa://
See iPhone
**iPhone**
return gMaxHeapSize - gHeapSize;
**Unix**
if using mmap return heapLimit - heapSize, otherwise zero
**Windows**
normally it's mStat.dwAvailPhys, but if includingSwap then also include mStat.dwAvailPageFile
adjust to maxReserved space (MAX_VIRTUAL_MEMORY= 512mb)
**BUGS**
Most platforms have disagreement about what this means.
**Parms**:
includingSwap If true use swap space in calculation
**return**: bytes allocated for squeak oops space, but not used
**From**: Interpreter
**Why**:
To give indication how much more the image could grow.
**Responsibility**:
This is very windows centric, it returns bytes left of allocated but not used space.
But on BSD systems we don't know or care about swap space size.
**MacIntosh**
//os-9/OSXCarbon//
return gMaxHeapSize - gHeapSize;
//Cocoa://
See iPhone
**iPhone**
return gMaxHeapSize - gHeapSize;
**Unix**
if using mmap return heapLimit - heapSize, otherwise zero
**Windows**
normally it's mStat.dwAvailPhys, but if includingSwap then also include mStat.dwAvailPageFile
adjust to maxReserved space (MAX_VIRTUAL_MEMORY= 512mb)
**BUGS**
Most platforms have disagreement about what this means.