[Pharo-project] [update 1.3] #13171
13171 - Issue 4074: Catchall for trivialities Issue 4037: Source search in Finder should be case insensitive -- Marcus Denker -- http://www.marcusdenker.de INRIA Lille -- Nord Europe. Team RMoD.
Re: [Pharo-project] out of memory - cog on windows
Hi Igor I'm sure it it was in windows vm ... years ago I used to specify it with squeak vm because of long startup time. and the code seems to be still here in sqWin32Intel.c , but I don' t think it is used anymore , because there is also sqAllocateMemory in sqWin32Alloc.c (did not investigate much). sqWin32Intel.c: { ARG_UINT, dwMemorySize, -memory: }, /* megabyte of memory to use */ ... #ifdef NO_VIRTUAL_MEMORY if(!dwMemorySize) { dwMemorySize = 4; virtualMemory = (int)imageSize + max(imageSize, dwMemorySize * 0x0010); } else { virtualMemory = (int)dwMemorySize * 0x0010; } #else /* initial commit size = imageSize + 4MB */ virtualMemory = imageSize + 0x0040; #endif Regards, Alain Igor Stasenko siguc...@gmail.com a écrit dans le message de news: banlktim6hxhbxjov24hxqrdjzz1qrzy...@mail.gmail.com... On 22 April 2011 22:48, Andres Valloud avall...@smalltalk.comcastbiz.net wrote: It's nice to see how to set up one's environment. The specific compiler versions, as well as versions of the relevant SDKs, should be well documented so that anyone can reproduce an official build. Indeed. That's the idea. IMHO, it seems a bit weird that a command line switch was superceded with a #define. i'm not sure if there was such switch on windoze. -- Best regards, Igor Stasenko AKA sig.
Re: [Pharo-project] Fwd: [Vm-dev] Re: out of memory - cog on windows
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 avall...@smalltalk.comcastbiz.net a écrit dans le message de news: 4db247e5.7020...@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.r...@gmx.de mailto:andreas.r...@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-...@lists.squeakfoundation.org mailto:vm-...@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 marianop...@gmail.com mailto:marianop...@gmail.com a écrit dans le message de news: BANLkTi=tved13_kl7quozemoxpnccfw...@mail.gmail.com mailto:BANLkTi=tved13_kl7quozemoxpnccfw...@mail.gmail.com... On Thu, Apr 21, 2011 at 10:21 PM, Tudor Girba tudor.gi...@gmail.com mailto:tudor.gi...@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
Re: [Pharo-project] Fwd: [Vm-dev] Re: out of memory - cog on windows
On 23 April 2011 13:19, Alain_Rastoul alr@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 avall...@smalltalk.comcastbiz.net a écrit dans le message de news: 4db247e5.7020...@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.r...@gmx.de mailto:andreas.r...@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-...@lists.squeakfoundation.org mailto:vm-...@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 marianop...@gmail.com mailto:marianop...@gmail.com a écrit dans le message de news: BANLkTi=tved13_kl7quozemoxpnccfw...@mail.gmail.com mailto:BANLkTi=tved13_kl7quozemoxpnccfw...@mail.gmail.com... On Thu, Apr 21, 2011 at 10:21 PM, Tudor Girba tudor.gi...@gmail.com mailto:tudor.gi...@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
[Pharo-project] MessageNotUnderstood: Transcript classtheme
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
Re: [Pharo-project] is there a way to know whether an object is registered to an announcer?
Is the expected number of registered objects be such that for present platform performance the O(n) worst case time to know the answer is OK? my 0.01... -- Cesar Rabak Em 23/04/2011 07:58, Stéphane Ducasse stephane.duca...@inria.fr escreveu: 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 stef
Re: [Pharo-project] MessageNotUnderstood: Transcript classtheme
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 marianop...@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
[Pharo-project] curl / http request
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
Re: [Pharo-project] is there a way to know whether an object is registered to an announcer?
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.
Re: [Pharo-project] A ready only transcript does not fly
+9 Please, put back the old theaded transcript. On Fri, Apr 22, 2011 at 11:06 PM, Stéphane Ducasse stephane.duca...@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
Re: [Pharo-project] Fwd: [Vm-dev] Re: out of memory - cog on windows
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 avall...@smalltalk.comcastbiz.net a écrit dans le message de news: 4db247e5.7020...@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.r...@gmx.de mailto:andreas.r...@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-...@lists.squeakfoundation.org mailto:vm-...@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 marianop...@gmail.com mailto:marianop...@gmail.com a écrit dans le message de news: BANLkTi=tved13_kl7quozemoxpnccfw...@mail.gmail.com mailto:BANLkTi=tved13_kl7quozemoxpnccfw...@mail.gmail.com... On Thu, Apr 21, 2011 at 10:21 PM, Tudor Girba tudor.gi...@gmail.com mailto:tudor.gi...@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
Re: [Pharo-project] Fwd: [Vm-dev] Re: out of memory - cog on windows
Some seemingly useful items to start tracing through Google appear here... http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/b1548cd5e7c15a8b/05628751f5f46111?pli=1 On 4/23/11 6:17 , Igor Stasenko wrote: On 23 April 2011 13:19, Alain_Rastoulalr@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 avall...@smalltalk.comcastbiz.net a écrit dans le message de news: 4db247e5.7020...@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.r...@gmx.de mailto:andreas.r...@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-...@lists.squeakfoundation.org mailto:vm-...@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 marianop...@gmail.com mailto:marianop...@gmail.com a écrit dans le message de news: BANLkTi=tved13_kl7quozemoxpnccfw...@mail.gmail.com mailto:BANLkTi=tved13_kl7quozemoxpnccfw...@mail.gmail.com... On Thu, Apr 21, 2011 at 10:21 PM, Tudor Girba tudor.gi...@gmail.com mailto:tudor.gi...@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
Re: [Pharo-project] About (nil@nil)
On Apr 21, 2011, at 19:32 , Igor Stasenko wrote: On 21 April 2011 18:42, Stéphane Ducasse stephane.duca...@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
Re: [Pharo-project] About (nil@nil)
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 ..
[Pharo-project] About testing that ensure works
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
Re: [Pharo-project] About testing that ensure works
First question what i wanna ask is: - why do you need to play with two different instances of organizer, and especially in such manner (temporary swapping forth and back)? This code doesn't looks to be good. On 24 April 2011 00:44, Stéphane Ducasse stephane.duca...@inria.fr wrote: 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 -- Best regards, Igor Stasenko AKA sig.
Re: [Pharo-project] Fwd: [Vm-dev] Re: out of memory - cog on windows
You can determine the switches better than me... for us, it was /LARGEADDRESSAWARE, also a linker switch: http://msdn.microsoft.com/en-us/library/wz223b1z.aspx Now, keep in mind that expanding the address space capability of the app doesn't mean Windows will give it 4gb. Under some Windows configurations, that won't happen unless you change how Windows boots. Under some versions, 4gb is just not possible. See here: http://msdn.microsoft.com/en-us/library/aa366778%28v=VS.85%29.aspx On 4/23/11 15:40 , Igor Stasenko wrote: On 23 April 2011 21:48, Andres Valloud avall...@smalltalk.comcastbiz.net wrote: Some seemingly useful items to start tracing through Google appear here... http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/b1548cd5e7c15a8b/05628751f5f46111?pli=1 so we can add '-Wl,--large-address-aware'. option to linker.
Re: [Pharo-project] Fwd: [Vm-dev] Re: out of memory - cog on windows
Interesting bit from the docs here: Addresses near the 2-GB boundary are typically used by various system DLLs. Therefore, a 32-bit process cannot allocate more than 2 GB of contiguous memory, even if the entire 4-GB address space is available. http://msdn.microsoft.com/en-us/library/bb613473%28v=VS.85%29.aspx Maybe more fundamental changes are needed, such as the ability to change the image's memory footprint dynamically. On 4/23/11 17:34 , Andres Valloud wrote: You can determine the switches better than me... for us, it was /LARGEADDRESSAWARE, also a linker switch: http://msdn.microsoft.com/en-us/library/wz223b1z.aspx Now, keep in mind that expanding the address space capability of the app doesn't mean Windows will give it 4gb. Under some Windows configurations, that won't happen unless you change how Windows boots. Under some versions, 4gb is just not possible. See here: http://msdn.microsoft.com/en-us/library/aa366778%28v=VS.85%29.aspx On 4/23/11 15:40 , Igor Stasenko wrote: On 23 April 2011 21:48, Andres Valloud avall...@smalltalk.comcastbiz.net wrote: Some seemingly useful items to start tracing through Google appear here... http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/b1548cd5e7c15a8b/05628751f5f46111?pli=1 so we can add '-Wl,--large-address-aware'. option to linker.
[Pharo-project] What is a well documented class?
Hi! I am dreaming about a tool to help me document source code. The question I have is what is a well documented class? What do you think about the following: A well documented class is a class: - that contains a class comment - its class comments contains either an example, or an associated unit test - without 'as yet unclassified' method category - each public method belongs to a method category named public* - each private method belongs to a method category named private* - each method contains a comment, located before the declaration of temporary variables - other methods are considered as package visible, meaning that they belong to a category that does not begins with 'private' or 'public' - without commented code contained in its methods. Is there anything else? Cheers, Alexandre -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
[Pharo-project] Memory profiling
Hi! I have been working on a memory profiler for Pharo. People who attended Smalltalks'10 may remember Mariano Coca's presentation. Unfortunately, I am not satisfied with what we can obtain from the execution of a piece of code in Pharo. The amount of memory consumed by a method _significantly varies_ across execution. I have the impression that memory consumption is a less stable metric than execution time. For example, I used this as a benchmark: -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 7 timesRepeat: [ 5 timesRepeat: [ Smalltalk garbageCollect]. MemoryProfiler viewProfiling: [ 20 timesRepeat: [| view | 5 timesRepeat: [ Smalltalk garbageCollect]. Object new. Object new. 5 timesRepeat: [ Smalltalk garbageCollect]. view := MOViewRenderer new. view nodes: (1 to: 5000). view root applyLayout] ] inPackagesMatching: 'Mondrian-*' ] -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= It opens a simple visualization in Mondrian. I tried to clean as much as I can before executing the code with multiple garbage collect. This piece of code return 7 profiles. In a profile I have for the method MOBoundedShapeheightFor: : Number of Young Allocated Bytes: 42,879,008 bytes Number of Old Allocated Bytes: 6,000,660 bytes Total Allocated Bytes: 48,879,668 bytes Number of Increased Memory Bytes: 0 bytes Number of Incremental GC's: 1,415 Number of Full GC's: 0 Number of Tenures of Surving Objects: 164 In another profile I have: Number of Young Allocated Bytes: -7,857,156 bytes Number of Old Allocated Bytes: 6,008,872 bytes Total Allocated Bytes: -1,848,284 bytes Number of Increased Memory Bytes: 0 bytes Number of Incremental GC's: 1,373 Number of Full GC's: 0 Number of Tenures of Surving Objects: 165 In another: Number of Young Allocated Bytes: -11,956,720 bytes Number of Old Allocated Bytes: 5,315,216 bytes Total Allocated Bytes: -6,641,504 bytes Number of Increased Memory Bytes: 0 bytes Number of Incremental GC's: 1,354 Number of Full GC's: 0 Number of Tenures of Surving Objects: 145 And another: Number of Young Allocated Bytes: 59,132,472 bytes Number of Old Allocated Bytes: 6,177,772 bytes Total Allocated Bytes: 65,310,244 bytes Number of Increased Memory Bytes: 0 bytes Number of Incremental GC's: 1,361 Number of Full GC's: 0 Number of Tenures of Surving Objects: 167 The metric Number of Young Allocated Bytes, Number of Old Allocated Bytes, Total Allocated Bytes are highly unpredictable: i.e., two profiles are likely to be completely different. I am not sure why is this so. I use the standard Pharo1.2 One click, without additional parameter to the VM. Do you think that other platforms and languages behave the same? However, the positive point is that it seems that the amount of incremental GC and the number of tenured objects may play an important role in estimating the memory consumption. These metrics are much more stable. What do you think on this? Does it make sense to say that more a method triggers incremental GC, more it consumes memory? What exactly triggers an incremental GC? Cheers, Alexandre -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.