[Pharo-project] react on low space
bschwab at anest.ufl.edu
Wed Feb 2 13:18:15 CET 2011
I'm on your side, really :) Silent failures are a big problem and should not be allowed to persist. What I don't know is whether the remedy for low space is simply to log it and then proceed to crash, or if a handler can do something useful. The handler probably would need to be registered; otherwise, the low space condition might show up in a thread other than the one hogging all of the memory, I think.
If a handler had to bail me out, I would probably want that logged, but if it is my handler, I should be able to do the logging.
From: pharo-project-bounces at lists.gforge.inria.fr [pharo-project-bounces at lists.gforge.inria.fr] On Behalf Of Max Leske [maxleske at gmail.com]
Sent: Wednesday, February 02, 2011 3:16 AM
To: Pharo-project at lists.gforge.inria.fr
Subject: Re: [Pharo-project] react on low space
I agree that it is important to at least know that there has been a low space condition. But then again, if there is a low space watcher anyway, shouldn't there be a way to register as a listener or something?
I haven't run your code yet but it looks exactly like what I was looking for! Thanks.
On 01.02.2011, at 14:13, Igor Stasenko wrote:
> On 1 February 2011 14:11, Igor Stasenko <siguctua at gmail.com> wrote:
>> I think you can catch the OutOfMemory exception:
> Oops. example was a bit wrong. something like that:
> [ | y x | y := x := Array new: 1000.
> 1000000 timesRepeat: [ x at: 1 put: (Array new: 10000). x := x at: 1 ]
> ] on: OutOfMemory do: [:ex |
>> On 1 February 2011 12:00, Max Leske <maxleske at gmail.com> wrote:
>>> I'm bumping this message. I think it's an important question and could help
>>> other developers who might have the same problem one day. The low space
>>> watcher is cool but if you don't get the chance to actually look at the
>>> stack it's pretty useless.
>>> On 30.01.2011, at 13:10, Max Leske wrote:
>>> Hi guys
>>> Is there an easy way to react on low space? Something like:
>>> SmalltalkImage isSpaceLow
>>> ifTrue: [ <suspend my process> ]
>>> The reason I'm asking is that I have a background process running that
>>> causes a low space condition but I never get around to opening the debugger
>>> and the image crashes on me. So for debugging purposes I'd like to
>>> periodically check the space that is left or alternatively be notified if
>>> low space is signalled.
>>> Any ideas?
>> Best regards,
>> Igor Stasenko AKA sig.
> Best regards,
> Igor Stasenko AKA sig.
More information about the Pharo-project