Bugs item #1906837, was opened at 2008-03-04 01:24 Message generated for change (Comment added) made by nobody You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=111005&aid=1906837&group_id=11005
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: long list creation Initial Comment: Hi Creation of long strings can completely hang the system. The cause for the hanging is described as follows. In the following simple macro string = "" for(i=0; i<N ; i++) string = string "\n" i each iteration eats memory since new string is created and old one is also kept in memory. When all memory is occupied a system completely hangs. When fast-access memory (non-swap) is fully occupied, work is strongly slowed-down, CPU usage drops to 1-10%. Memory is not freed when macro is completed, as a result, the system goes in a "somnambular state". X-server restarting does not help in this case. This bug is independent of NEdit's version. Alexey Kuznetsov ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2008-05-14 06:52 Message: Logged In: NO Hi, I think, even "simple" implementation of memory checking/freeing after a macro execution/breaking and after a number of allocations can be very helpful. Alexey ---------------------------------------------------------------------- Comment By: Tony Balinski (ajbj) Date: 2008-05-14 00:18 Message: Logged In: YES user_id=618141 Originator: NO It's actually quite easy to convert NEdit macro's mark/sweep technique so that it can run during macro execution. I have a working version of NEdit that does this. What needs to be done is to allow the mark part to run through the active macro call stacks, allowing marking of function-local strings and arrays. For this all continuation contexts need to be accessible. So it's all quite easy to do, although it's not clear how often it should be done (other than at the end of macro execution). My current implementation calls the GC after every 10000 allocations or so. A better scheme might relate amount of memory allocated and number of allocations instead, which might be better in cases such as this bug highlights. I have worked on a ref-counted memory management scheme, but that is rather more involved, requiring a lot of reorganising and care in programming. I'll make a patch when I have a moment so that others can try it. Tony ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=111005&aid=1906837&group_id=11005 -- NEdit Develop mailing list - [email protected] http://www.nedit.org/mailman/listinfo/develop
