From: Thomas M. <tho...@we...> - 2012-07-30 14:20:00
|
Am Dienstag, den 24.07.2012, 13:22 -0600 schrieb Dale Anson: Hello, > Thomas, do you have a test case to reproduce the OOM Error in search > and replace? It seems to me that it should be pretty easy to tell if > the error is recoverable or not. There might not be anything useful to > do to recover the memory, but avoiding an application hang and being > able to alert the user to restart jEdit would be much better than > having jEdit appear to lock up. Take and unpack the text file from patch 3527797 http://sourceforge.net/tracker/download.php?group_id=588&atid=300588&file_id=443849&aid=3527797 Search for regular expression: (.), and replace all with beanshell snippet: _0 + " " that should do the trick. > > Dale > > PS I read the stackoverflow thread. It looks like one guy says don't > do it and quite a few others say you can, but be careful. What I got > out of that was a definite "maybe". > > > On Tue, Jul 24, 2012 at 12:41 PM, Jarek Czekalski > <jar...@po...> wrote: > W dniu 07/23/2012 10:46 AM, Thomas Meyer pisze: > > Am Sonntag, den 22.07.2012, 21:22 +0200 schrieb Jarek > Czekalski: > >> W dniu 07/16/2012 09:14 PM, SourceForge.net pisze: > >>> Patches item #3544730, was opened at 2012-07-16 12:14 > >>> Submitted By: Thomas Meyer (thomasmey) > >>> > >>> Initial Comment: > >>> OutOfMemory Throwable is an Error. Search&Replace only > catches Exceptions. Fix it. > >> I don't think we should catch out of memory error. After > that "there is > >> no way to get a defined behaviour". I agree with the > opinion taken from > >> stackoverflow. > >> > >> > http://stackoverflow.com/questions/1692230/is-it-possible-to-catch-out-of-memory-exception-in-java > >> > >> What do you think? > > I think it's okay, to catch the OOM Error in the > searc&replace (all) > > case. It gives a nice user experience, without it jEdit > seems tp hang. > > > Did you read the stackoverflow thread? The argument about nice > user > experience seems a bit amusing compared to serious analyze > there. Try to > prove they are wrong and that it's absolutely safe to catch > OOM in the > code the way you do. Only this way you may convince me. > > > Besides that there are already two places where an OOM Error > is catched > > in jEdit: > > BufferLoadRequest > > JEditKillRing > > > Maybe they should be reconsidered too. I don't think they are > examples > of proper oom handling. > > Jarek > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security > and > threat landscape has changed and how IT managers can respond. > Discussions > will include endpoint security, mobile security and the latest > in malware > threats. > http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > -- > ----------------------------------------------- > jEdit Developers' List > jEd...@li... > https://lists.sourceforge.net/lists/listinfo/jedit-devel > > |