9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] 'Undo' memory under Acme
@ 2006-06-24 13:43 Gabriel Diaz
  2006-06-24 13:50 ` quanstro
  0 siblings, 1 reply; 5+ messages in thread
From: Gabriel Diaz @ 2006-06-24 13:43 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Hello,

I was editing a big output from acid, and after doing some Edit
commands (specially one big s//), i got the memory full of Undo
changes.

I tryed to clean the memory closing that window (using Del command)
but the memory remains filled. Then i just restarted acme.

Is there a way to clean the Undo memory when needed?

As the output was generated line by line, clicking Undo one million
times is not an option.

thanks,

gabi


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] 'Undo' memory under Acme
  2006-06-24 13:43 [9fans] 'Undo' memory under Acme Gabriel Diaz
@ 2006-06-24 13:50 ` quanstro
  2006-06-24 14:38   ` Gabriel Diaz
  0 siblings, 1 reply; 5+ messages in thread
From: quanstro @ 2006-06-24 13:50 UTC (permalink / raw)
  To: 9fans

undo memory is per-buffer and is freed when the buffer is deleted.
(file.c:300)

i'm not sure what the problem you're having is.  what is the exact error
message?  do you have a backtrace?

- erik

On Sat Jun 24 08:43:42 CDT 2006, gabidiaz@gmail.com wrote:
> Hello,
> 
> I was editing a big output from acid, and after doing some Edit
> commands (specially one big s//), i got the memory full of Undo
> changes.
> 
> I tryed to clean the memory closing that window (using Del command)
> but the memory remains filled. Then i just restarted acme.
> 
> Is there a way to clean the Undo memory when needed?
> 
> As the output was generated line by line, clicking Undo one million
> times is not an option.
> 
> thanks,
> 
> gabi


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] 'Undo' memory under Acme
  2006-06-24 13:50 ` quanstro
@ 2006-06-24 14:38   ` Gabriel Diaz
  2006-06-24 18:50     ` quanstro
  0 siblings, 1 reply; 5+ messages in thread
From: Gabriel Diaz @ 2006-06-24 14:38 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Hello

This is the ps:

gdiaz         73842    0:17   0:08   815784K Rendez   acme
gdiaz         73843    0:00   0:00   815784K Rendez   acme
gdiaz         73844    0:00   0:00   815784K Pread    acme
gdiaz         73845    0:00   0:00   815784K Pread    acme
gdiaz         73846    0:00   0:00   815784K Pread    acme
gdiaz         73847    0:01   0:01   815784K Pread    acme
gdiaz         73848    0:00   0:00   815784K Pread    acme
gdiaz         75996    0:00   0:00   815784K Await    acme

This is what i did:

start up acme
run a win command
run acid -l trump on that window agains a proc
then run trump() in acid

run other win command
make that proc do things to produce results in the trump()
(that is a huge output)

run a couple of Edit commands with results in other window
(no high memory usage)

then run Edit commands with the output in the same window
(run Edit ,s/.//g to test)
then the memory usage goes high

i tryed to run Undo command on the "win" window, and the memory usage
was getting lower. but when i undo the big Edit s/./ command, the
usage is still high, so pressing undo more times deletes line by line
the acid output. But i pressed undo a couple of times (> 1Kb of
undoes) and seems the memory usage doesn't change, so may be it was
freeing other more recent changes :-?

I closed the window but the memory still appears as used.

I tryed it again and this is what i get:

<stdin>:2: (error) windir: can't write address 0x1a120: bad process or
channel control request

in all that output i missed it the first time.

and now if you Edit ,s/.//g i got:

address out of range
win: error writing addr: address out of range
win 83205: error writing addr: %r

the command i originally used didn't showed that error, i think it was
a Edit s/./ but not 100% sure, as i did a couple of Edits until i see
that i was getting out of memory.

Edit ,>wc-l told the window has 16567 lines and 4855542 chars.

what do you thing i should do to make more tests? my knowledge of acme
is limited to a user level atm :).

acme didn't crash just win (or seems so). how can i debug that? (the
win process is not there when it dies)

thanks

gabi



On 6/24/06, quanstro@quanstro.net <quanstro@quanstro.net> wrote:
> undo memory is per-buffer and is freed when the buffer is deleted.
> (file.c:300)
>
> i'm not sure what the problem you're having is.  what is the exact error
> message?  do you have a backtrace?
>
> - erik
>
> On Sat Jun 24 08:43:42 CDT 2006, gabidiaz@gmail.com wrote:
> > Hello,
> >
> > I was editing a big output from acid, and after doing some Edit
> > commands (specially one big s//), i got the memory full of Undo
> > changes.
> >
> > I tryed to clean the memory closing that window (using Del command)
> > but the memory remains filled. Then i just restarted acme.
> >
> > Is there a way to clean the Undo memory when needed?
> >
> > As the output was generated line by line, clicking Undo one million
> > times is not an option.
> >
> > thanks,
> >
> > gabi
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] 'Undo' memory under Acme
  2006-06-24 14:38   ` Gabriel Diaz
@ 2006-06-24 18:50     ` quanstro
  2006-06-25  2:51       ` Russ Cox
  0 siblings, 1 reply; 5+ messages in thread
From: quanstro @ 2006-06-24 18:50 UTC (permalink / raw)
  To: 9fans

why are your win windows running with undo?  typically that's disabled, right?
so i can't dulicate anything like what you're seeing.  for testing, i modified
undo to take a argument -- the number of undos to issue.  i couldn't find
any leaks and using silly commands like Edit s:.:&:g do not use any more
memory for me after 1 cycle than they do after repeating  "Undo n" followed
by the same edit.  in my case n was ~256k.

it seems that this problem depends on all the writes() by acid being interpreted as
seperate actions with sepeate undos.  i'll bet $10 that if you modify acid to
use bio for output, you will get much more reasonable memory usage.

also, acme memory usage will remain high even if you delete the buffer.  brk() is not called
by libc or any other libraries or applications.  (this would be the only way for
an application to return memory to the kernel as sbrk takes a ulong /increase/
in the brk.)  thus, you can call free all you want, but ps will still report the 
same memory usage.

- erik

On Sat Jun 24 09:38:43 CDT 2006, gabidiaz@gmail.com wrote:
> Hello
> 
> This is the ps:
> 
> gdiaz         73842    0:17   0:08   815784K Rendez   acme
> gdiaz         73843    0:00   0:00   815784K Rendez   acme
> gdiaz         73844    0:00   0:00   815784K Pread    acme
> gdiaz         73845    0:00   0:00   815784K Pread    acme
> gdiaz         73846    0:00   0:00   815784K Pread    acme
> gdiaz         73847    0:01   0:01   815784K Pread    acme
> gdiaz         73848    0:00   0:00   815784K Pread    acme
> gdiaz         75996    0:00   0:00   815784K Await    acme
> 
> This is what i did:
> 
> start up acme
> run a win command
> run acid -l trump on that window agains a proc
> then run trump() in acid
> 
> run other win command
> make that proc do things to produce results in the trump()
> (that is a huge output)
> 
> run a couple of Edit commands with results in other window
> (no high memory usage)


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] 'Undo' memory under Acme
  2006-06-24 18:50     ` quanstro
@ 2006-06-25  2:51       ` Russ Cox
  0 siblings, 0 replies; 5+ messages in thread
From: Russ Cox @ 2006-06-25  2:51 UTC (permalink / raw)
  To: 9fans

> why are your win windows running with undo?  typically that's disabled, right?

Not having Undo in the tag doesn't preclude you
from typing Undo and then executing it.
All windows have an undo buffer.

Russ



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-06-25  2:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-24 13:43 [9fans] 'Undo' memory under Acme Gabriel Diaz
2006-06-24 13:50 ` quanstro
2006-06-24 14:38   ` Gabriel Diaz
2006-06-24 18:50     ` quanstro
2006-06-25  2:51       ` Russ Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).