Hi - 

I don't have a need for a big image.  I just discovered I have no idea how to 
make one larger than ~512MB, and am curious.  

I was running into an out of memory error and discussing it in a thread on 
pharo-users list 
(http://forum.world.st/running-out-of-memory-while-processing-a-220MB-csv-file-with-NeoCSVReader-tips-tp4790264p4790441.html).
  The details of that discussion aren't pertinent to this question.  

This script below ought to make an image that maxes out well above a GB but 
cannot cross 512MB without throwing an OutOfMemory error.  


| them | 
them := OrderedCollection new. 
[[them addLast: (ByteArray new: 16000000). 
 Transcript cr; show: ((Smalltalk vm parameterAt: 3) / (1024*1024.0) 
printShowingDecimalPlaces: 1); flush] repeat] 
on: OutOfMemory 
do: [:ex| 2 to: them size by: 2 do: [:i| them at: i put: nil. Smalltalk 
garbageCollect]]. 
Transcript cr; show: ((Smalltalk vm parameterAt: 3) / (1024*1024.0) 
printShowingDecimalPlaces: 1); flush. 
them := nil. 
Smalltalk garbageCollect. 
Transcript cr; show: ((Smalltalk vm parameterAt: 3) / (1024*1024.0) 
printShowingDecimalPlaces: 1); flush


In the transcript you will see an output of the image size as more ByteArrays 
are added to the OrderedCollection.  On my laptop with 4GB of ram it always 
peaks at just over 500MB.  

Setting the memory from the command line (e.g. pharo-ui --memory 1000m  
Pharo.image) does not help.

Is there a VM flag that I need to flip?

Thanks

Paul

Reply via email to