zsh-workers
 help / color / mirror / code / Atom feed
From: "\"xRaich[o]²x\"" <raichoo@googlemail.com>
To: zsh-workers@sunsite.dk
Subject: Re: [PATCH] compsys maps anonymous memory and never frees it
Date: Mon, 08 Sep 2008 23:19:22 +0200	[thread overview]
Message-ID: <48C596DA.9050202@gmail.com> (raw)
In-Reply-To: <200809071504.36084.arvidjaar@newmail.ru>

Andrey Borzenkov wrote:
> On Sunday 07 September 2008, xRaich[o]²x wrote:
>   
>> Bart Schaefer wrote:
>>     
>>> On Sep 4,  1:04am, =?ISO-8859-1?Q?Bj=F6rn_Herzig?= wrote:
>>> }
>>> } I looked at the problem a little closer. Zsh does not call mmap to
>>> } allocate them and they dont get allocated when completion happens but
>>> } when the next command gets issued.
>>>
>>>       
>
> I was able to more or less reproduce it on Linux; but now after your patch
> I get what looks like memory leak. Here are heaps after several memory
> intensive completions:
>
> Address   Kbytes     RSS    Anon  Locked Mode   Mapping
> 08048000     608       -       -       - r-x--  zsh
> 080e0000      16       -       -       - rw---  zsh
> 080e4000      92       -       -       - rw---    [ anon ]
> 09d6a000     672       -       -       - rw---    [ anon ]
>
> [...]
>
> Address   Kbytes     RSS    Anon  Locked Mode   Mapping
> 08048000     608       -       -       - r-x--  zsh
> 080e0000      16       -       -       - rw---  zsh
> 080e4000      92       -       -       - rw---    [ anon ]
> 09d6a000    5340       -       -       - rw---    [ anon ]
> b6a68000   15464       -       -       - rw---    [ anon ]
>
>
> Compare this with version without patch:
>
> Address   Kbytes     RSS    Anon  Locked Mode   Mapping
> 08048000     528       -       -       - r-x--  zsh
> 080cc000      16       -       -       - rw---  zsh
> 080d0000      88       -       -       - rw---    [ anon ]
> 099df000     744       -       -       - rw---    [ anon ]
>
> [...]
>
> Address   Kbytes     RSS    Anon  Locked Mode   Mapping
> 08048000     528       -       -       - r-x--  zsh
> 080cc000      16       -       -       - rw---  zsh
> 080d0000      88       -       -       - rw---    [ anon ]
> 099df000    5520       -       -       - rw---    [ anon ]
> b6adb000   15464       -       -       - rw---    [ anon ]
> b7a05000      12       -       -       - rw---    [ anon ]
> b7b46000     108       -       -       - rw---    [ anon ]
>
> So it looks like we still have some memory leak somewhere. 
>   
Are you sure that those segments aren't those dlopen allocates when 
loading modules? they are actually created by the operating system and 
needed.

What i find a bit disturbing is that whenever loading modules one 
segment gets unmapped by munmap with two times its size. I think the 
operating system will catch that but maybe this is possible to fix 
somehow. i wrote a little dtrace script that keeps track of every mapped 
segment and checks if they get munmapped with the correct size. 
Everything except the mentioned munmap seems to work after the patch.

Regards,
Björn


      reply	other threads:[~2008-09-08 21:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <48BDF1EC.4050204@gmail.com>
     [not found] ` <080902200652.ZM9887@torch.brasslantern.com>
     [not found]   ` <682f90440809031604j5e349af2q8d40f24fc429dcc3@mail.gmail.com>
     [not found]     ` <080904072526.ZM12341@torch.brasslantern.com>
2008-09-07  8:23       ` "xRaich[o]²x"
2008-09-07  9:25         ` Andrey Borzenkov
2008-09-07 11:04         ` Andrey Borzenkov
2008-09-08 21:19           ` "xRaich[o]²x" [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48C596DA.9050202@gmail.com \
    --to=raichoo@googlemail.com \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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).