Pharo-dev
By thread
pharo-dev@lists.pharo.org
By month
Messages by month
- ----- 2026 -----
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
April 2011
- 110 participants
- 2378 messages
[Pharo-project] About testing that ensure works
by Stéphane Ducasse
Hi guys
in RPackage there is a method named withOrganizer:do: defined as follows and I would like to test it to understand really if it does
what it says.
withOrganizer: aNewOrganizer do: aBlock
"Perform an action locally to aNewOrganizer. Does not impact any other organizers."
| old shouldRegisterAtTheEnd|
[
old := self organizer.
shouldRegisterAtTheEnd := false.
old hasRegistered ifTrue: [
old unregister.
shouldRegisterAtTheEnd := true.
].
self organizer: aNewOrganizer.
aBlock cull: aNewOrganizer.] ensure: [
self organizer: old.
shouldRegisterAtTheEnd ifTrue: [
self organizer register.
].
aNewOrganizer unregister.
]
So I wrote two tests
testWithDoIsCorrectlyReinstallingDefault
"self debug: #testWithDoIsCorrectlyReinstallingDefault"
| current empty |
current := RPackageOrganizer default.
empty := RPackageOrganizer basicNew initialize.
RPackage withOrganizer: empty
do: [ self assert: (SystemAnnouncer announcer hasSubscriber: empty).
self deny: (SystemAnnouncer announcer hasSubscriber: current)].
self assert: (SystemAnnouncer announcer hasSubscriber: current).
self deny: (SystemAnnouncer announcer hasSubscriber: empty)
and
testWithDoIsCorrectlyReinstallingDefaultEvenIfHalt
"self debug: #testWithDoIsCorrectlyReinstallingDefaultEvenIfHalt"
| current empty |
current := RPackageOrganizer default.
empty := RPackageOrganizer basicNew initialize.
RPackage withOrganizer: empty
do: [ self error.
self assert: (SystemAnnouncer announcer hasSubscriber: empty).
self deny: (SystemAnnouncer announcer hasSubscriber: current)].
self assert: (SystemAnnouncer announcer hasSubscriber: current).
self deny: (SystemAnnouncer announcer hasSubscriber: empty)
Now I would like to make sure that I raise an error or whaever to make sure that the ensure: block argument
is executed. Does anybody have an idea how I can do that. because self error does not work.
Stef
April 23, 2011
Re: [Pharo-project] About (nil@nil)
by Stéphane Ducasse
I would like at least to have a well initialized point because it can break tools using the system to generate
examples.
Stef
On Apr 21, 2011, at 7:32 PM, Igor Stasenko wrote:
> probably there was a primitives which doing fast Point allocaiton, and
> for this it takes an existing point instance as a prototype.
> I don't know if this slot are used by something ..
April 23, 2011
Re: [Pharo-project] About (nil@nil)
by Adrian Lienhard
On Apr 21, 2011, at 19:32 , Igor Stasenko wrote:
> On 21 April 2011 18:42, Stéphane Ducasse <stephane.ducasse(a)inria.fr> wrote:
>> of course it is there
>>
>> newArray at: 34 put: Point new.
>>
>> now could not we have a well initialized point?
>> What is the purpose of this one?
>>
>
> probably there was a primitives which doing fast Point allocaiton, and
> for this it takes an existing point instance as a prototype.
> I don't know if this slot are used by something ..
It doesn't seem so. I (quickly) checked the VM sources and couldn't find an access to this array slot...
Adrian
April 23, 2011
Re: [Pharo-project] curl / http request
by Sven Van Caekenberghe
Hey Camillo,
On 23 Apr 2011, at 20:05, Camillo Bruni wrote:
> I am too dumb and there is too little documentation which is hard to find :).
> So can anyone tell me how I do the following bash thingy in pharo?
>
> curl $URL --data-binary $SOME_FILE -H 'Content-type:application/json'
>
> I don't manage to get this working properly. I guess HTTPSocket is the class to use...
>
> thanks a lot
> camillo
Well, Zinc HTTP Components [1], of course:
| json entity |
json := (FileStream fileNamed: '/tmp/foo.json') contentsOfEntireFile.
entity := ZnEntity with: json type: ZnMimeType applicationJson.
ZnClient post: 'http://example.com/foo' data: entity
This will return a ZnResponse, inspect it for more details.
There are many more options, but this is a simple example to get you started.
The source code should be your friend.
Sven
[1] http://homepage.mac.com/svc/Zinc-HTTP-Components
April 23, 2011
Re: [Pharo-project] Fwd: [Vm-dev] Re: out of memory - cog on windows
by Andres Valloud
I thought I'd mention... some supported Windows configurations require
additional work to allow apps to use more than 2gb. So, even if you
compile with (IIRC) /LARGEADDRESSAWARE, it may not always be enough.
On 4/23/11 11:48 , Andres Valloud wrote:
> Some seemingly useful items to start tracing through Google appear here...
>
> http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/b1548cd5e7…
>
> On 4/23/11 6:17 , Igor Stasenko wrote:
>> On 23 April 2011 13:19, Alain_Rastoul<alr.dev(a)free.fr> wrote:
>>> The code for memory allocation is in sqWin32Alloc.c
>>> There is MAX_VIRTUAL_MEMORYMB reserved in virtual address space for each vm
>>> (512MB)
>>> maxReserved = MAX_VIRTUAL_MEMORY;
>>> do {
>>> pageBase = VirtualAlloc(NULL,maxReserved,MEM_RESERVE, PAGE_NOACCESS);
>>> if(!pageBase) {
>>> if(maxReserved == nowReserved) break;
>>> /* make it smaller in steps of 128MB */
>>> maxReserved -= 128*1024*1024;
>>> if(maxReserved< nowReserved) maxReserved = nowReserved;
>>> }
>>> } while(!pageBase);
>>>
>>> I don't know gcc compilation flag for address space> 2G for 32b apps on 64
>>> bits ?
>>> ((MS) /LARGEADDRESSEPACE gcc equivalent ?)
>>> Do you know it ?
>>
>> No idea :)
>>
>>>
>>> "Andres Valloud"
>>> <avalloud(a)smalltalk.comcastbiz.net> a écrit dans le
>>> message de news: 4DB247E5.7020404(a)smalltalk.comcastbiz.net...
>>>> Does that mean that, even if your app uses 128mb of RAM, the VM will
>>>> allocate 512mb of memory regardless? It seems a bit strange that just 1gb
>>>> worth of allocations would cause problems. What about the load address of
>>>> the VM and the way the memory chunk is allocated? Has the 32 bit VM been
>>>> compiled to indicate the app is 32 bit address aware (if not, address
>>>> space is limited to 2gb)?
>>>>
>>>> On 4/22/11 14:44 , Mariano Martinez Peck wrote:
>>>>>
>>>>>
>>>>> ---------- Forwarded message ----------
>>>>> From: *Andreas Raab*<andreas.raab(a)gmx.de
>>>>> <mailto:andreas.raab@gmx.de>>
>>>>> Date: Fri, Apr 22, 2011 at 3:01 PM
>>>>> Subject: Re: [Vm-dev] Re: [Pharo-project] out of memory - cog on windows
>>>>> To: vm-dev(a)lists.squeakfoundation.org
>>>>> <mailto:vm-dev@lists.squeakfoundation.org>
>>>>>
>>>>>
>>>>>
>>>>> FWIW, the reason for the 512MB limit has to do with Windows memory
>>>>> layout. When you're running applications that load dynamic libraries
>>>>> (directly or indirectly such as when using ODBC which loads further
>>>>> DLLs) Windows needs (sometimes a lot of) address space to map these DLLs
>>>>> in order to load them[*]. When the VM starts it grabs MAX_VIRTUAL_MEMORY
>>>>> from the OS which will consequently not be available to map DLLs into.
>>>>> We have found that depending on the libraries in use and depending on
>>>>> the overall system utilization, loading DLLs would fail seemingly "at
>>>>> random" which, after further investigation, we were able to track to
>>>>> reserving too much address space upfront. We were able to show
>>>>> experimentally, that changing the limit from 1GB to 512MB would on some
>>>>> machines make all the difference.
>>>>>
>>>>> [*] This is true in particular for libraries that create more threads as
>>>>> the default Windows policy is to create threads with the stack size of
>>>>> the application executable. Thus a 1MB default stack in the application
>>>>> will by default create all further threads to be allocated with a 1MB
>>>>> stack size. Of course all of this is subject to various other conditions.
>>>>>
>>>>> In the end we concluded that 512MB is a reasonable size for most apps
>>>>> and with 512MB we've never seen these random failures. You can increase
>>>>> the limit by recompiling the VM, but if you ship your app in diverse
>>>>> environments you should be aware of the potential issues.
>>>>>
>>>>> Cheers,
>>>>> - Andreas
>>>>>
>>>>> On 4/21/2011 22:44, Alain_Rastoul wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>> Apparently, the vm allocates MAX_VIRTUAL_MEMORY and reduces by steps
>>>>>> of 128M until it
>>>>>> succeeds.
>>>>>> so I suppose it could be possible to allocate 2Gb and see how it runs
>>>>>> on a 1Gb system and if this is not too much stress for
>>>>>> the system (thinking of the pagefile) ?
>>>>>> Tudor is your vm a cog or non cog vm ?
>>>>>>
>>>>>> "Mariano Martinez Peck"
>>>>>> <marianopeck(a)gmail.com
>>>>>> <mailto:marianopeck@gmail.com>> a
>>>>>> écrit dans le message de news:
>>>>>>
>>>>>> BANLkTi=Tved13_KL7quOzemOXPnCcfWw+g(a)mail.gmail.com
>>>>>>
>>>>>> <mailto:BANLkTi=Tved13_KL7quOzemOXPnCcfWw+g@mail.gmail.com>...
>>>>>>
>>>>>> ------------------------------------------------------------------------
>>>>>>
>>>>>>
>>>>>> On Thu, Apr 21, 2011 at 10:21 PM, Tudor Girba
>>>>>> <tudor.girba(a)gmail.com
>>>>>> <mailto:tudor.girba@gmail.com>> wrote:
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> Should I to understand that the only way to enable more memory
>>>>>> is to recompile the VM? Does that mean that there is no way to
>>>>>> pass this information as a parameter like we can on Mac?
>>>>>>
>>>>>>
>>>>>> As far as I know you can pass a parameter, but even so, it won't
>>>>>> be able to allocate more than 512MB.
>>>>>> I can compile the VM for you with this change in 5 minutes. But I
>>>>>> am not sure that such simple code would make it work. I think such
>>>>>> limit is there because of something. Otherwise, it sounds stupid
>>>>>> imposing a limit just because.
>>>>>>
>>>>>> The problem is that I cannot recompile the VM because I have
>>>>>> no access to a Windows machine. Is there one available that
>>>>>> provides more memory?
>>>>>>
>>>>>>
>>>>>> I don't think so, but start cc'ing the VM mailing list. You'd
>>>>>> probably receive more help.
>>>>>>
>>>>>> Cheers
>>>>>>
>>>>>> Mariano
>>>>>>
>>>>>> Cheers,
>>>>>> Doru
>>>>>>
>>>>>>
>>>>>> On 21 Apr 2011, at 22:09, Alain_Rastoul wrote:
>>>>>>
>>>>>> > Hi Tudor,
>>>>>> >
>>>>>> > There is a constant in sqWin32Alloc.h (platforms\win32\vm) :
>>>>>> > #define MAX_VIRTUAL_MEMORY 512*1024*1024
>>>>>> > you can change it to whatever you want and rebuild the vm,
>>>>>> > for exzmple give all the available memory less 256 M .
>>>>>> >
>>>>>> > HTH
>>>>>> >
>>>>>> > Regards
>>>>>> > Alain
>>>>>> >
>>>>>> > "Tudor Girba"
>>>>>> <tudor.girba(a)gmail.com
>>>>>> <mailto:tudor.girba@gmail.com>> a
>>>>>> écrit
>>>>>> > dans le message de news:
>>>>>>
>>>>>> 03B9389F-C719-44D0-B106-2AC78B120F56(a)gmail.com
>>>>>>
>>>>>> <mailto:03B9389F-C719-44D0-B106-2AC78B120F56@gmail.com>...
>>>>>> > Hi,
>>>>>> >
>>>>>> > We have no specific startUp: methods in Moose. In any case,
>>>>>> the issue with
>>>>>> > opening the image does not seem to be related to startUp:.
>>>>>> >
>>>>>> > Is it really true that the Cog VM is limited to 512MB of
>>>>>> memory?
>>>>>> >
>>>>>> > Cheers,
>>>>>> > Doru
>>>>>> >
>>>>>> >
>>>>>> > On 21 Apr 2011, at 14:27, Luc Fabresse wrote:
>>>>>> >
>>>>>> >> Hi Doru,
>>>>>> >>
>>>>>> >> 2011/4/21 Tudor Girba
>>>>>> >> <tudor.girba(a)gmail.com
>>>>>> <mailto:tudor.girba@gmail.com>>
>>>>>> >> Hi,
>>>>>> >>
>>>>>> >>
>>>>>> >>
>>>>>> >> On Apr 21, 2011, at 14:06, Mariano Martinez Peck
>>>>>> >> <marianopeck(a)gmail.com
>>>>>> <mailto:marianopeck@gmail.com>> wrote:
>>>>>> >>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> On Thu, Apr 21, 2011 at 1:58 PM, Tudor Girba
>>>>>> >>> <tudor.girba(a)gmail.com
>>>>>> <mailto:tudor.girba@gmail.com>> wrote:
>>>>>> >>>> Hi again,
>>>>>> >>>>
>>>>>> >>>> I did not say what the problem was :). The problem was
>>>>>> that when
>>>>>> >>>> opening the image on Windows, he got a Space is low
>>>>>> message and the
>>>>>> >>>> image was not usable (see attachment).
>>>>>> >>>
>>>>>> >>> That's weird. Does moose have something on the startup
>>>>>> list? something
>>>>>> >>> that can be bothering there?
>>>>>> >>
>>>>>> >> Not that I know of. Is there a way to check this?
>>>>>> >>
>>>>>> >> Classes should be registered using Smalltlak
>>>>>> addToStartUpList: aClass
>>>>>> >> Then aClass class>>#startUp: is executed at startup.
>>>>>> >> So implementors of #startUp: on Moose classes should give
>>>>>> you the answer.
>>>>>> >>
>>>>>> >> #Luc
>>>>>> >>
>>>>>> >>
>>>>>> >> Actually, using exactly the same process some days ago he
>>>>>> produced an
>>>>>> >> image of 190MB. This one works just fine on Windows. The
>>>>>> only difference
>>>>>> >> between the two is the size of the loaded data.
>>>>>> >>
>>>>>> >> It would be really bad news if the Windows vm would be so
>>>>>> severely limited
>>>>>> >> in terms of memory.
>>>>>> >>
>>>>>> >> Cheers,
>>>>>> >> Doru
>>>>>> >>
>>>>>> >>
>>>>>> >>>
>>>>>> >>> On Mac it worked just fine.
>>>>>> >>>>
>>>>>> >>>> Cheers,
>>>>>> >>>> Doru
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>> On 21 Apr 2011, at 12:52, Tudor Girba wrote:
>>>>>> >>>>
>>>>>> >>>>> Hi,
>>>>>> >>>>>
>>>>>> >>>>> I received a question from someone running a 200MB image
>>>>>> on Windows
>>>>>> >>>>> using Cog 2361.
>>>>>> >>>>>
>>>>>> >>>>> If I open the image on Mac, it works just fine.
>>>>>> Unfortunately, I do
>>>>>> >>>>> not have a Windows machine around, and I cannot test but
>>>>>> I believe it
>>>>>> >>>>> should be solvable by increasing the allocated memory.
>>>>>> >>>>>
>>>>>> >>>>> On Mac, I would run it with: ./Croquet -memory 1500m
>>>>>> >>>>>
>>>>>> >>>>> Can anyone help me with the right incantation for Windows?
>>>>>> >>>>>
>>>>>> >>>>> Cheers,
>>>>>> >>>>> Doru
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>> --
>>>>>> >>>>> www.tudorgirba.com<http://www.tudorgirba.com>
>>>>>> >>>>>
>>>>>> >>>>> "What we can governs what we wish."
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>> <Space is low.png>
>>>>>> >>>>
>>>>>> >>>> --
>>>>>> >>>> www.tudorgirba.com<http://www.tudorgirba.com>
>>>>>> >>>>
>>>>>> >>>> "Yesterday is a fact.
>>>>>> >>>> Tomorrow is a possibility.
>>>>>> >>>> Today is a challenge."
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> --
>>>>>> >>> Mariano
>>>>>> >>> http://marianopeck.wordpress.com
>>>>>> >>>
>>>>>> >>
>>>>>> >
>>>>>> > --
>>>>>> > www.tudorgirba.com<http://www.tudorgirba.com>
>>>>>> >
>>>>>> > "Beauty is where we see it."
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>>
>>>>>> --
>>>>>> www.tudorgirba.com<http://www.tudorgirba.com>
>>>>>>
>>>>>> "If you interrupt the barber while he is cutting your hair,
>>>>>> you will end up with a messy haircut."
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Mariano
>>>>>> http://marianopeck.wordpress.com
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Mariano
>>>>> http://marianopeck.wordpress.com
>>>>>
>>>>
>>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>> --
>> Best regards,
>> Igor Stasenko AKA sig.
>>
>
April 23, 2011
Re: [Pharo-project] Fwd: [Vm-dev] Re: out of memory - cog on windows
by Andres Valloud
Some seemingly useful items to start tracing through Google appear here...
http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/b1548cd5e7…
On 4/23/11 6:17 , Igor Stasenko wrote:
> On 23 April 2011 13:19, Alain_Rastoul<alr.dev(a)free.fr> wrote:
>> The code for memory allocation is in sqWin32Alloc.c
>> There is MAX_VIRTUAL_MEMORYMB reserved in virtual address space for each vm
>> (512MB)
>> maxReserved = MAX_VIRTUAL_MEMORY;
>> do {
>> pageBase = VirtualAlloc(NULL,maxReserved,MEM_RESERVE, PAGE_NOACCESS);
>> if(!pageBase) {
>> if(maxReserved == nowReserved) break;
>> /* make it smaller in steps of 128MB */
>> maxReserved -= 128*1024*1024;
>> if(maxReserved< nowReserved) maxReserved = nowReserved;
>> }
>> } while(!pageBase);
>>
>> I don't know gcc compilation flag for address space> 2G for 32b apps on 64
>> bits ?
>> ((MS) /LARGEADDRESSEPACE gcc equivalent ?)
>> Do you know it ?
>
> No idea :)
>
>>
>> "Andres Valloud"
>> <avalloud(a)smalltalk.comcastbiz.net> a écrit dans le
>> message de news: 4DB247E5.7020404(a)smalltalk.comcastbiz.net...
>>> Does that mean that, even if your app uses 128mb of RAM, the VM will
>>> allocate 512mb of memory regardless? It seems a bit strange that just 1gb
>>> worth of allocations would cause problems. What about the load address of
>>> the VM and the way the memory chunk is allocated? Has the 32 bit VM been
>>> compiled to indicate the app is 32 bit address aware (if not, address
>>> space is limited to 2gb)?
>>>
>>> On 4/22/11 14:44 , Mariano Martinez Peck wrote:
>>>>
>>>>
>>>> ---------- Forwarded message ----------
>>>> From: *Andreas Raab*<andreas.raab(a)gmx.de
>>>> <mailto:andreas.raab@gmx.de>>
>>>> Date: Fri, Apr 22, 2011 at 3:01 PM
>>>> Subject: Re: [Vm-dev] Re: [Pharo-project] out of memory - cog on windows
>>>> To: vm-dev(a)lists.squeakfoundation.org
>>>> <mailto:vm-dev@lists.squeakfoundation.org>
>>>>
>>>>
>>>>
>>>> FWIW, the reason for the 512MB limit has to do with Windows memory
>>>> layout. When you're running applications that load dynamic libraries
>>>> (directly or indirectly such as when using ODBC which loads further
>>>> DLLs) Windows needs (sometimes a lot of) address space to map these DLLs
>>>> in order to load them[*]. When the VM starts it grabs MAX_VIRTUAL_MEMORY
>>>> from the OS which will consequently not be available to map DLLs into.
>>>> We have found that depending on the libraries in use and depending on
>>>> the overall system utilization, loading DLLs would fail seemingly "at
>>>> random" which, after further investigation, we were able to track to
>>>> reserving too much address space upfront. We were able to show
>>>> experimentally, that changing the limit from 1GB to 512MB would on some
>>>> machines make all the difference.
>>>>
>>>> [*] This is true in particular for libraries that create more threads as
>>>> the default Windows policy is to create threads with the stack size of
>>>> the application executable. Thus a 1MB default stack in the application
>>>> will by default create all further threads to be allocated with a 1MB
>>>> stack size. Of course all of this is subject to various other conditions.
>>>>
>>>> In the end we concluded that 512MB is a reasonable size for most apps
>>>> and with 512MB we've never seen these random failures. You can increase
>>>> the limit by recompiling the VM, but if you ship your app in diverse
>>>> environments you should be aware of the potential issues.
>>>>
>>>> Cheers,
>>>> - Andreas
>>>>
>>>> On 4/21/2011 22:44, Alain_Rastoul wrote:
>>>>>
>>>>>
>>>>>
>>>>> Apparently, the vm allocates MAX_VIRTUAL_MEMORY and reduces by steps
>>>>> of 128M until it
>>>>> succeeds.
>>>>> so I suppose it could be possible to allocate 2Gb and see how it runs
>>>>> on a 1Gb system and if this is not too much stress for
>>>>> the system (thinking of the pagefile) ?
>>>>> Tudor is your vm a cog or non cog vm ?
>>>>>
>>>>> "Mariano Martinez Peck"
>>>>> <marianopeck(a)gmail.com
>>>>> <mailto:marianopeck@gmail.com>> a
>>>>> écrit dans le message de news:
>>>>>
>>>>> BANLkTi=Tved13_KL7quOzemOXPnCcfWw+g(a)mail.gmail.com
>>>>>
>>>>> <mailto:BANLkTi=Tved13_KL7quOzemOXPnCcfWw+g@mail.gmail.com>...
>>>>>
>>>>> ------------------------------------------------------------------------
>>>>>
>>>>>
>>>>> On Thu, Apr 21, 2011 at 10:21 PM, Tudor Girba
>>>>> <tudor.girba(a)gmail.com
>>>>> <mailto:tudor.girba@gmail.com>> wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> Should I to understand that the only way to enable more memory
>>>>> is to recompile the VM? Does that mean that there is no way to
>>>>> pass this information as a parameter like we can on Mac?
>>>>>
>>>>>
>>>>> As far as I know you can pass a parameter, but even so, it won't
>>>>> be able to allocate more than 512MB.
>>>>> I can compile the VM for you with this change in 5 minutes. But I
>>>>> am not sure that such simple code would make it work. I think such
>>>>> limit is there because of something. Otherwise, it sounds stupid
>>>>> imposing a limit just because.
>>>>>
>>>>> The problem is that I cannot recompile the VM because I have
>>>>> no access to a Windows machine. Is there one available that
>>>>> provides more memory?
>>>>>
>>>>>
>>>>> I don't think so, but start cc'ing the VM mailing list. You'd
>>>>> probably receive more help.
>>>>>
>>>>> Cheers
>>>>>
>>>>> Mariano
>>>>>
>>>>> Cheers,
>>>>> Doru
>>>>>
>>>>>
>>>>> On 21 Apr 2011, at 22:09, Alain_Rastoul wrote:
>>>>>
>>>>> > Hi Tudor,
>>>>> >
>>>>> > There is a constant in sqWin32Alloc.h (platforms\win32\vm) :
>>>>> > #define MAX_VIRTUAL_MEMORY 512*1024*1024
>>>>> > you can change it to whatever you want and rebuild the vm,
>>>>> > for exzmple give all the available memory less 256 M .
>>>>> >
>>>>> > HTH
>>>>> >
>>>>> > Regards
>>>>> > Alain
>>>>> >
>>>>> > "Tudor Girba"
>>>>> <tudor.girba(a)gmail.com
>>>>> <mailto:tudor.girba@gmail.com>> a
>>>>> écrit
>>>>> > dans le message de news:
>>>>>
>>>>> 03B9389F-C719-44D0-B106-2AC78B120F56(a)gmail.com
>>>>>
>>>>> <mailto:03B9389F-C719-44D0-B106-2AC78B120F56@gmail.com>...
>>>>> > Hi,
>>>>> >
>>>>> > We have no specific startUp: methods in Moose. In any case,
>>>>> the issue with
>>>>> > opening the image does not seem to be related to startUp:.
>>>>> >
>>>>> > Is it really true that the Cog VM is limited to 512MB of
>>>>> memory?
>>>>> >
>>>>> > Cheers,
>>>>> > Doru
>>>>> >
>>>>> >
>>>>> > On 21 Apr 2011, at 14:27, Luc Fabresse wrote:
>>>>> >
>>>>> >> Hi Doru,
>>>>> >>
>>>>> >> 2011/4/21 Tudor Girba
>>>>> >> <tudor.girba(a)gmail.com
>>>>> <mailto:tudor.girba@gmail.com>>
>>>>> >> Hi,
>>>>> >>
>>>>> >>
>>>>> >>
>>>>> >> On Apr 21, 2011, at 14:06, Mariano Martinez Peck
>>>>> >> <marianopeck(a)gmail.com
>>>>> <mailto:marianopeck@gmail.com>> wrote:
>>>>> >>
>>>>> >>>
>>>>> >>>
>>>>> >>> On Thu, Apr 21, 2011 at 1:58 PM, Tudor Girba
>>>>> >>> <tudor.girba(a)gmail.com
>>>>> <mailto:tudor.girba@gmail.com>> wrote:
>>>>> >>>> Hi again,
>>>>> >>>>
>>>>> >>>> I did not say what the problem was :). The problem was
>>>>> that when
>>>>> >>>> opening the image on Windows, he got a Space is low
>>>>> message and the
>>>>> >>>> image was not usable (see attachment).
>>>>> >>>
>>>>> >>> That's weird. Does moose have something on the startup
>>>>> list? something
>>>>> >>> that can be bothering there?
>>>>> >>
>>>>> >> Not that I know of. Is there a way to check this?
>>>>> >>
>>>>> >> Classes should be registered using Smalltlak
>>>>> addToStartUpList: aClass
>>>>> >> Then aClass class>>#startUp: is executed at startup.
>>>>> >> So implementors of #startUp: on Moose classes should give
>>>>> you the answer.
>>>>> >>
>>>>> >> #Luc
>>>>> >>
>>>>> >>
>>>>> >> Actually, using exactly the same process some days ago he
>>>>> produced an
>>>>> >> image of 190MB. This one works just fine on Windows. The
>>>>> only difference
>>>>> >> between the two is the size of the loaded data.
>>>>> >>
>>>>> >> It would be really bad news if the Windows vm would be so
>>>>> severely limited
>>>>> >> in terms of memory.
>>>>> >>
>>>>> >> Cheers,
>>>>> >> Doru
>>>>> >>
>>>>> >>
>>>>> >>>
>>>>> >>> On Mac it worked just fine.
>>>>> >>>>
>>>>> >>>> Cheers,
>>>>> >>>> Doru
>>>>> >>>>
>>>>> >>>>
>>>>> >>>
>>>>> >>>>
>>>>> >>>>
>>>>> >>>>
>>>>> >>>> On 21 Apr 2011, at 12:52, Tudor Girba wrote:
>>>>> >>>>
>>>>> >>>>> Hi,
>>>>> >>>>>
>>>>> >>>>> I received a question from someone running a 200MB image
>>>>> on Windows
>>>>> >>>>> using Cog 2361.
>>>>> >>>>>
>>>>> >>>>> If I open the image on Mac, it works just fine.
>>>>> Unfortunately, I do
>>>>> >>>>> not have a Windows machine around, and I cannot test but
>>>>> I believe it
>>>>> >>>>> should be solvable by increasing the allocated memory.
>>>>> >>>>>
>>>>> >>>>> On Mac, I would run it with: ./Croquet -memory 1500m
>>>>> >>>>>
>>>>> >>>>> Can anyone help me with the right incantation for Windows?
>>>>> >>>>>
>>>>> >>>>> Cheers,
>>>>> >>>>> Doru
>>>>> >>>>>
>>>>> >>>>>
>>>>> >>>>> --
>>>>> >>>>> www.tudorgirba.com<http://www.tudorgirba.com>
>>>>> >>>>>
>>>>> >>>>> "What we can governs what we wish."
>>>>> >>>>>
>>>>> >>>>>
>>>>> >>>>>
>>>>> >>>>> <Space is low.png>
>>>>> >>>>
>>>>> >>>> --
>>>>> >>>> www.tudorgirba.com<http://www.tudorgirba.com>
>>>>> >>>>
>>>>> >>>> "Yesterday is a fact.
>>>>> >>>> Tomorrow is a possibility.
>>>>> >>>> Today is a challenge."
>>>>> >>>>
>>>>> >>>>
>>>>> >>>>
>>>>> >>>
>>>>> >>>
>>>>> >>>
>>>>> >>>
>>>>> >>> --
>>>>> >>> Mariano
>>>>> >>> http://marianopeck.wordpress.com
>>>>> >>>
>>>>> >>
>>>>> >
>>>>> > --
>>>>> > www.tudorgirba.com<http://www.tudorgirba.com>
>>>>> >
>>>>> > "Beauty is where we see it."
>>>>> >
>>>>> >
>>>>> >
>>>>> >
>>>>> >
>>>>> >
>>>>> >
>>>>> >
>>>>>
>>>>> --
>>>>> www.tudorgirba.com<http://www.tudorgirba.com>
>>>>>
>>>>> "If you interrupt the barber while he is cutting your hair,
>>>>> you will end up with a messy haircut."
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Mariano
>>>>> http://marianopeck.wordpress.com
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Mariano
>>>> http://marianopeck.wordpress.com
>>>>
>>>
>>>
>>
>>
>>
>>
>>
>
>
>
> --
> Best regards,
> Igor Stasenko AKA sig.
>
April 23, 2011
Re: [Pharo-project] Fwd: [Vm-dev] Re: out of memory - cog on windows
by Andres Valloud
Not off the top of my head, we use VisualStudio for VisualWorks.
On 4/23/11 3:19 , Alain_Rastoul wrote:
> The code for memory allocation is in sqWin32Alloc.c
> There is MAX_VIRTUAL_MEMORYMB reserved in virtual address space for each vm
> (512MB)
> maxReserved = MAX_VIRTUAL_MEMORY;
> do {
> pageBase = VirtualAlloc(NULL,maxReserved,MEM_RESERVE, PAGE_NOACCESS);
> if(!pageBase) {
> if(maxReserved == nowReserved) break;
> /* make it smaller in steps of 128MB */
> maxReserved -= 128*1024*1024;
> if(maxReserved< nowReserved) maxReserved = nowReserved;
> }
> } while(!pageBase);
>
> I don't know gcc compilation flag for address space> 2G for 32b apps on 64
> bits ?
> ((MS) /LARGEADDRESSEPACE gcc equivalent ?)
> Do you know it ?
>
> "Andres Valloud"
> <avalloud(a)smalltalk.comcastbiz.net> a écrit dans le
> message de news: 4DB247E5.7020404(a)smalltalk.comcastbiz.net...
>> Does that mean that, even if your app uses 128mb of RAM, the VM will
>> allocate 512mb of memory regardless? It seems a bit strange that just 1gb
>> worth of allocations would cause problems. What about the load address of
>> the VM and the way the memory chunk is allocated? Has the 32 bit VM been
>> compiled to indicate the app is 32 bit address aware (if not, address
>> space is limited to 2gb)?
>>
>> On 4/22/11 14:44 , Mariano Martinez Peck wrote:
>>>
>>>
>>> ---------- Forwarded message ----------
>>> From: *Andreas Raab*<andreas.raab(a)gmx.de
>>> <mailto:andreas.raab@gmx.de>>
>>> Date: Fri, Apr 22, 2011 at 3:01 PM
>>> Subject: Re: [Vm-dev] Re: [Pharo-project] out of memory - cog on windows
>>> To: vm-dev(a)lists.squeakfoundation.org
>>> <mailto:vm-dev@lists.squeakfoundation.org>
>>>
>>>
>>>
>>> FWIW, the reason for the 512MB limit has to do with Windows memory
>>> layout. When you're running applications that load dynamic libraries
>>> (directly or indirectly such as when using ODBC which loads further
>>> DLLs) Windows needs (sometimes a lot of) address space to map these DLLs
>>> in order to load them[*]. When the VM starts it grabs MAX_VIRTUAL_MEMORY
>>> from the OS which will consequently not be available to map DLLs into.
>>> We have found that depending on the libraries in use and depending on
>>> the overall system utilization, loading DLLs would fail seemingly "at
>>> random" which, after further investigation, we were able to track to
>>> reserving too much address space upfront. We were able to show
>>> experimentally, that changing the limit from 1GB to 512MB would on some
>>> machines make all the difference.
>>>
>>> [*] This is true in particular for libraries that create more threads as
>>> the default Windows policy is to create threads with the stack size of
>>> the application executable. Thus a 1MB default stack in the application
>>> will by default create all further threads to be allocated with a 1MB
>>> stack size. Of course all of this is subject to various other conditions.
>>>
>>> In the end we concluded that 512MB is a reasonable size for most apps
>>> and with 512MB we've never seen these random failures. You can increase
>>> the limit by recompiling the VM, but if you ship your app in diverse
>>> environments you should be aware of the potential issues.
>>>
>>> Cheers,
>>> - Andreas
>>>
>>> On 4/21/2011 22:44, Alain_Rastoul wrote:
>>>>
>>>>
>>>>
>>>> Apparently, the vm allocates MAX_VIRTUAL_MEMORY and reduces by steps
>>>> of 128M until it
>>>> succeeds.
>>>> so I suppose it could be possible to allocate 2Gb and see how it runs
>>>> on a 1Gb system and if this is not too much stress for
>>>> the system (thinking of the pagefile) ?
>>>> Tudor is your vm a cog or non cog vm ?
>>>>
>>>> "Mariano Martinez Peck"
>>>> <marianopeck(a)gmail.com
>>>> <mailto:marianopeck@gmail.com>> a
>>>> écrit dans le message de news:
>>>>
>>>> BANLkTi=Tved13_KL7quOzemOXPnCcfWw+g(a)mail.gmail.com
>>>>
>>>> <mailto:BANLkTi=Tved13_KL7quOzemOXPnCcfWw+g@mail.gmail.com>...
>>>>
>>>> ------------------------------------------------------------------------
>>>>
>>>>
>>>> On Thu, Apr 21, 2011 at 10:21 PM, Tudor Girba
>>>> <tudor.girba(a)gmail.com
>>>> <mailto:tudor.girba@gmail.com>> wrote:
>>>>
>>>> Hi,
>>>>
>>>> Should I to understand that the only way to enable more memory
>>>> is to recompile the VM? Does that mean that there is no way to
>>>> pass this information as a parameter like we can on Mac?
>>>>
>>>>
>>>> As far as I know you can pass a parameter, but even so, it won't
>>>> be able to allocate more than 512MB.
>>>> I can compile the VM for you with this change in 5 minutes. But I
>>>> am not sure that such simple code would make it work. I think such
>>>> limit is there because of something. Otherwise, it sounds stupid
>>>> imposing a limit just because.
>>>>
>>>> The problem is that I cannot recompile the VM because I have
>>>> no access to a Windows machine. Is there one available that
>>>> provides more memory?
>>>>
>>>>
>>>> I don't think so, but start cc'ing the VM mailing list. You'd
>>>> probably receive more help.
>>>>
>>>> Cheers
>>>>
>>>> Mariano
>>>>
>>>> Cheers,
>>>> Doru
>>>>
>>>>
>>>> On 21 Apr 2011, at 22:09, Alain_Rastoul wrote:
>>>>
>>>> > Hi Tudor,
>>>> >
>>>> > There is a constant in sqWin32Alloc.h (platforms\win32\vm) :
>>>> > #define MAX_VIRTUAL_MEMORY 512*1024*1024
>>>> > you can change it to whatever you want and rebuild the vm,
>>>> > for exzmple give all the available memory less 256 M .
>>>> >
>>>> > HTH
>>>> >
>>>> > Regards
>>>> > Alain
>>>> >
>>>> > "Tudor Girba"
>>>> <tudor.girba(a)gmail.com
>>>> <mailto:tudor.girba@gmail.com>> a
>>>> écrit
>>>> > dans le message de news:
>>>>
>>>> 03B9389F-C719-44D0-B106-2AC78B120F56(a)gmail.com
>>>>
>>>> <mailto:03B9389F-C719-44D0-B106-2AC78B120F56@gmail.com>...
>>>> > Hi,
>>>> >
>>>> > We have no specific startUp: methods in Moose. In any case,
>>>> the issue with
>>>> > opening the image does not seem to be related to startUp:.
>>>> >
>>>> > Is it really true that the Cog VM is limited to 512MB of
>>>> memory?
>>>> >
>>>> > Cheers,
>>>> > Doru
>>>> >
>>>> >
>>>> > On 21 Apr 2011, at 14:27, Luc Fabresse wrote:
>>>> >
>>>> >> Hi Doru,
>>>> >>
>>>> >> 2011/4/21 Tudor Girba
>>>> >> <tudor.girba(a)gmail.com
>>>> <mailto:tudor.girba@gmail.com>>
>>>> >> Hi,
>>>> >>
>>>> >>
>>>> >>
>>>> >> On Apr 21, 2011, at 14:06, Mariano Martinez Peck
>>>> >> <marianopeck(a)gmail.com
>>>> <mailto:marianopeck@gmail.com>> wrote:
>>>> >>
>>>> >>>
>>>> >>>
>>>> >>> On Thu, Apr 21, 2011 at 1:58 PM, Tudor Girba
>>>> >>> <tudor.girba(a)gmail.com
>>>> <mailto:tudor.girba@gmail.com>> wrote:
>>>> >>>> Hi again,
>>>> >>>>
>>>> >>>> I did not say what the problem was :). The problem was
>>>> that when
>>>> >>>> opening the image on Windows, he got a Space is low
>>>> message and the
>>>> >>>> image was not usable (see attachment).
>>>> >>>
>>>> >>> That's weird. Does moose have something on the startup
>>>> list? something
>>>> >>> that can be bothering there?
>>>> >>
>>>> >> Not that I know of. Is there a way to check this?
>>>> >>
>>>> >> Classes should be registered using Smalltlak
>>>> addToStartUpList: aClass
>>>> >> Then aClass class>>#startUp: is executed at startup.
>>>> >> So implementors of #startUp: on Moose classes should give
>>>> you the answer.
>>>> >>
>>>> >> #Luc
>>>> >>
>>>> >>
>>>> >> Actually, using exactly the same process some days ago he
>>>> produced an
>>>> >> image of 190MB. This one works just fine on Windows. The
>>>> only difference
>>>> >> between the two is the size of the loaded data.
>>>> >>
>>>> >> It would be really bad news if the Windows vm would be so
>>>> severely limited
>>>> >> in terms of memory.
>>>> >>
>>>> >> Cheers,
>>>> >> Doru
>>>> >>
>>>> >>
>>>> >>>
>>>> >>> On Mac it worked just fine.
>>>> >>>>
>>>> >>>> Cheers,
>>>> >>>> Doru
>>>> >>>>
>>>> >>>>
>>>> >>>
>>>> >>>>
>>>> >>>>
>>>> >>>>
>>>> >>>> On 21 Apr 2011, at 12:52, Tudor Girba wrote:
>>>> >>>>
>>>> >>>>> Hi,
>>>> >>>>>
>>>> >>>>> I received a question from someone running a 200MB image
>>>> on Windows
>>>> >>>>> using Cog 2361.
>>>> >>>>>
>>>> >>>>> If I open the image on Mac, it works just fine.
>>>> Unfortunately, I do
>>>> >>>>> not have a Windows machine around, and I cannot test but
>>>> I believe it
>>>> >>>>> should be solvable by increasing the allocated memory.
>>>> >>>>>
>>>> >>>>> On Mac, I would run it with: ./Croquet -memory 1500m
>>>> >>>>>
>>>> >>>>> Can anyone help me with the right incantation for Windows?
>>>> >>>>>
>>>> >>>>> Cheers,
>>>> >>>>> Doru
>>>> >>>>>
>>>> >>>>>
>>>> >>>>> --
>>>> >>>>> www.tudorgirba.com<http://www.tudorgirba.com>
>>>> >>>>>
>>>> >>>>> "What we can governs what we wish."
>>>> >>>>>
>>>> >>>>>
>>>> >>>>>
>>>> >>>>> <Space is low.png>
>>>> >>>>
>>>> >>>> --
>>>> >>>> www.tudorgirba.com<http://www.tudorgirba.com>
>>>> >>>>
>>>> >>>> "Yesterday is a fact.
>>>> >>>> Tomorrow is a possibility.
>>>> >>>> Today is a challenge."
>>>> >>>>
>>>> >>>>
>>>> >>>>
>>>> >>>
>>>> >>>
>>>> >>>
>>>> >>>
>>>> >>> --
>>>> >>> Mariano
>>>> >>> http://marianopeck.wordpress.com
>>>> >>>
>>>> >>
>>>> >
>>>> > --
>>>> > www.tudorgirba.com<http://www.tudorgirba.com>
>>>> >
>>>> > "Beauty is where we see it."
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>>
>>>> --
>>>> www.tudorgirba.com<http://www.tudorgirba.com>
>>>>
>>>> "If you interrupt the barber while he is cutting your hair,
>>>> you will end up with a messy haircut."
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Mariano
>>>> http://marianopeck.wordpress.com
>>>>
>>>
>>>
>>>
>>>
>>> --
>>> Mariano
>>> http://marianopeck.wordpress.com
>>>
>>
>>
>
>
>
>
> .
>
April 23, 2011
Re: [Pharo-project] A ready only transcript does not fly
by Mariano Martinez Peck
+9999999999999
Please, put back the old theaded transcript.
On Fri, Apr 22, 2011 at 11:06 PM, Stéphane Ducasse <
stephane.ducasse(a)inria.fr> wrote:
> Fernando
> I think that we should rollback the transcript. because this is really
> annoying that we cannot use
> the transcript:
> copy and paste
> execute an expression there.
> May be this is better to improve the ThreadSafeTranscript.
> The new one looks like a regression and I'm quite sure people will not like
> it.
> So this was a good try but we should recognise when stuff do not work as
> good as we wanted.
>
> Stef
>
--
Mariano
http://marianopeck.wordpress.com
April 23, 2011
Re: [Pharo-project] MessageNotUnderstood: Transcript class>>theme
by Mariano Martinez Peck
http://code.google.com/p/pharo/issues/detail?id=4081
On Sat, Apr 23, 2011 at 7:51 PM, <csrabak(a)bol.com.br> wrote:
> Both :-)
>
> The former as the issue gets documented. The latter as for present image
> will not lead to an immediate action. . .
>
> --
> Cesar Rabak
>
>
> Em 23/04/2011 14:29, Mariano Martinez Peck < marianopeck(a)gmail.com >
> escreveu:
> This happens just trying to open a Transcript
>
> Transcript class >> taskbarIcon
> "Answer the icon for the receiver in a task bar."
>
> ^self theme smallLeftFlushIcon
>
>
> So..should I open a ticket or it is not worth it since the plan is to come
> back to the previous Transcript ?
>
>
> --
> Mariano
> http://marianopeck.wordpress.com
>
>
>
>
--
Mariano
http://marianopeck.wordpress.com
April 23, 2011
Re: [Pharo-project] is there a way to know whether an object is registered to an announcer?
by Stéphane Ducasse
>
> hi guys
>>
>>
>> is there a way to know whether an object is registered to an announcer?
>>
>> I propose
>>
>> isRegistering: anObject
>>
>> registry subscriptionsOf: anObject do: [:each | ^ true].
>> ^ false
>>
>>
>
> then more appropriate would be #hasSubscriber:
yes much better.
> May i ask why you need to test it?
sure I'm trying to understand why I have 6 instances of RPackageOrganizer and also the code of cyrille.
So knowing if a given instance is registered is important for me to debug and also to write some tests.
> Usually you don't need to test who subscribed to what. And if you do,
> then i suspect there are some design mistake.
Exactly, still the API should let me do what I have to do when I need it.
Stef
>
>
> --
> Best regards,
> Igor Stasenko AKA sig.
>
April 23, 2011