VM killing regex...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

VM killing regex...

talios@gmail.com
Just executed the following in a workspace and watched dolphin hang and
blow up in its memory use :(

'\d*' asRegex matchesIn: '9.' inspect

doh.


Reply | Threaded
Open this post in threaded view
|

Re: VM killing regex...

Chris Uppal-3
Mark Derricutt wrote:

> Just executed the following in a workspace and watched dolphin hang and
> blow up in its memory use :(
>
> '\d*' asRegex matchesIn: '9.' inspect
>
> doh.

I don't know if that should be considered a bug in Vassili's Regexp library (I
assume that's what you are using).  In once way it makes perfect sense --
'\d*' matches the empty string, so your input can be considered to consist of
an infinite sequence of matches:

    '9'
    ''
    ''
    ''
    ... and so on to infinity...

finally followed by the (non-matching) '.'.

To me that seems logical, maybe it does to you too (I can't interpret your
'doh' comment).  If not, and if you don't feel like hacking the regexp lib,
then I'm afraid it's just a case "so don't do that" ;-)

I'm pretty sure that Dolphin is supposed to handle out-of-memory /
out-of-object-table-space more gracefully than it does, but judging from a
previous thread (I've forgotten which) the trapping seems to have stopped
working in recent releases of the VM.

BTW, just in case you've missed it, you can interrupt run-away Processes with
<control>+<break> (usually -- it can take a little while for the VM to "notice"
that the interrupt has been issued  -- especially if the OS has already started
thrashing its virtual memory).

    -- chris


Reply | Threaded
Open this post in threaded view
|

Re: VM killing regex...

Andy Bower-3
In reply to this post by talios@gmail.com
Mark,

> Just executed the following in a workspace and watched dolphin hang
> and blow up in its memory use :(
>
> '\d*' asRegex matchesIn: '9.' inspect
>
> doh.

This thread from earlier in the year might help:

http://groups.google.com/groups?hl=en&lr=&c2coff=1&threadm=vg6k070h7o6g.
1cz1g12au81m3.dlg%4040tude.net&rnum=1&prev=/groups%3Fq%3Dregex%2Bdolphin
%2Bsmalltalk%26hl%3Den%26lr%3D%26c2coff%3D1%26selm%3Dvg6k070h7o6g.1cz1g1
2au81m3.dlg%254040tude.net%26rnum%3D1

Best regards

Andy Bower
Dolphin Support
www.object-arts.com