Quoting Bert Wesarg <[EMAIL PROTECTED]>:
> Hi,
>
> On Mon, Mar 3, 2008 at 2:58 PM, AVKuznetsov <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > I made a macro for word completion via local dict server
> > and tried its stability for huge number of completions.
> > Following bugs were observed.
> >
> > a) The macro uses calltip to show a list of completions.
> > In a long list (~5000 lines) lines superimposes each other.
> > Seems, overflowed "line counter" drops to zero
> > and new lines are "printed" over previous ones.
> 5000 lines! what do you expect? Ok a scrollable calltip would be nice,
> I have tried this several times, but gived up because I didn't get the
> scrollbars in automatic mode, ie show them only if needed.
>
> If any this is a motif bug.
>
> >
> >
> > b) Creation of long lists completely hangs the system. The
> > cause for the hanging is described as follows.
> >
> > In the following simple
> > string = ""
> > for(i=0; i<N ; i++)
> > string = string "\n" i
> >
> > each iteration eats memory since new string is created.
> > On my system (1.2G memory + 800M swap) a top limit of iterations
> > is 19800 and string of length of 107K is created. Both memory and
> > swap are full and AND THEY ARE NOT FREED WHEN MACRO IS COMPLETED!
> > Simple estimation shows that the memory occupation corresponds to
> > number of created interim strings.
> You can have this behavior much easier without NEdit:
>
> int
> main(int ac, char *av[])
> {
> for (unsigned long i; i < ULONG_MAX; i++)
> void *p = malloc(i);
> return 0;
> }
>
> So what do you expect, should NEdit limit the amount of usable memory?
> BTW: does NEdit crash?
>
> I would call both points programmer errors.
>
> Oh, and by the way, NEdit by itself can't return memory to the system.
> It can only say 'hey I don't need this anymore'.
The thing is, Alex has a very good point. The string memory management of
NEdit is awful. I started writing a refcounted version, but ground to a
halt, mainly because my source code is too much of a moving target! I do
believe it's necessary though. A case in point is Thorsten's sh2html
macros (which are great otherwise): run these with a large C file (macro.c
for example) and watch your system go to sleep (unles you've got
comfortably large memory space).
(It needs changing most of interpret.c and macro.c. These are the major
victims of my patches.)
Tony
--
NEdit Develop mailing list - [email protected]
http://www.nedit.org/mailman/listinfo/develop