[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Memory again
From: |
Carsten Mattner |
Subject: |
Re: Memory again |
Date: |
Thu, 8 Dec 2011 18:30:53 +0100 |
On Wed, Dec 7, 2011 at 3:01 PM, Stefan Monnier <address@hidden> wrote:
>>> > You are, in fact, saying that fontifying a 60-MByte compilation buffer
>>> > creates text properties and other supporting data structures that can
>>> > accrue to a total of 2G bytes. I find this extremely hard to believe.
>>> > A simple calculation will show that a file that has 1 million lines
>>> > with 5 different faces (warning, line number, column number,
>>> > underline, default) per line needs only a few million intervals -- how
>>> > can this require 2G bytes of memory?
>
> Because the property values are themselves non-trivial.
>
>>> Start fresh Emacs instance, make sure you're in *scratch*. Type M-x
>>> compilation-minor-mode, then eval (staying in *scratch*, of course):
>>>
>>> (let ((x 0)) (while (< x 1000000) (insert "test:1:oops\n") (setq x (1+ x))))
>>>
>>> Wait for completion, then see RSS. Next, kill *scratch*, M-x garbage-collect
>>> and see RSS again.
>
>> How is this different from compiling a C file with 1000000 #warning
>> directives? What am I missing?
>
> To test your buffer-reallocation theory, you could instead do
>
> (insert (apply #'concat (make-list 1000000 "test:1:oops\n")))
Again, totally unscientific test without real instruments.
On a fresh trunk --with-ns build:
paste "(insert (apply #'concat (make-list 1000000 "test:1:oops\n")))"
to *scratch* and M-x eval-buffer: from 21.8MB to 55.8MB
as this was *scratch*, open ~/.bashrc in another buffer and kill both
and it's down to 44.4MB
M-x garbage-collect 32.9MB
M-x garbage-collect, M-x garbage-collect: 29.2MB
- Re: Memory again, (continued)
- Re: Memory again, Carsten Mattner, 2011/12/06
- Re: Memory again, Dmitry Antipov, 2011/12/06
- Re: Memory again, Eli Zaretskii, 2011/12/06
- Re: Memory again, Stefan Monnier, 2011/12/06
- Re: Memory again, Eli Zaretskii, 2011/12/06
- Re: Memory again, Stefan Monnier, 2011/12/06
- Re: Memory again, Eli Zaretskii, 2011/12/07
- Re: Memory again, Dmitry Antipov, 2011/12/07
- Re: Memory again, Eli Zaretskii, 2011/12/07
- Re: Memory again, Stefan Monnier, 2011/12/07
- Re: Memory again,
Carsten Mattner <=
- Re: Memory again, Dmitry Antipov, 2011/12/08
- Re: Memory again, Carsten Mattner, 2011/12/09
- Re: Memory again, Eli Zaretskii, 2011/12/06
Re: Memory again, Óscar Fuentes, 2011/12/06
- Re: Memory again, Stefan Monnier, 2011/12/06
- Re: Memory again, Nix, 2011/12/11
- Re: Memory again, Tim Connors, 2011/12/14
- Re: Memory again, Eli Zaretskii, 2011/12/14
- Re: Memory again, Tim Connors, 2011/12/14
- Re: Memory again, Eli Zaretskii, 2011/12/15