I can run the following:

Array streamContents: [ :out |
  1 to: 20 do: [ :each |
    Transcript crShow: each asString.
    out nextPut: (ByteArray new: 16*1e6).
    Transcript crShow: ('Now using {1} Mb' format: { (Smalltalk vm memoryEnd / 
1e6) floor }) ] ].

but not higher.

> On 16 Nov 2014, at 23:48, Sven Van Caekenberghe <s...@stfx.eu> wrote:
> 
> Hi Paul,
> 
> Maybe this older discussion can help:
> 
> http://forum.world.st/Pharo-dev-Exploring-Heap-Size-Limits-td4696226.html#a4696272
> 
> especially Phil's explorations.
> 
> Regards,
> 
> Sven
> 
>> On 16 Nov 2014, at 21:49, Paul DeBruicker <pdebr...@gmail.com> wrote:
>> 
>> 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