mailing list of musl libc
 help / color / mirror / code / Atom feed
* application frequently map and unmap memory
@ 2016-08-01 22:06 Yuxin Ren
  2016-08-02 16:18 ` Rich Felker
  0 siblings, 1 reply; 4+ messages in thread
From: Yuxin Ren @ 2016-08-01 22:06 UTC (permalink / raw)
  To: musl

Hi all,

Are there any applications that stress the memory mapping and unmapping utility
(It frequently map and unmap memory)?

Thanks
Yuxin


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

* Re: application frequently map and unmap memory
  2016-08-01 22:06 application frequently map and unmap memory Yuxin Ren
@ 2016-08-02 16:18 ` Rich Felker
  2016-08-02 16:58   ` Yuxin Ren
  0 siblings, 1 reply; 4+ messages in thread
From: Rich Felker @ 2016-08-02 16:18 UTC (permalink / raw)
  To: musl

On Mon, Aug 01, 2016 at 06:06:29PM -0400, Yuxin Ren wrote:
> Hi all,
> 
> Are there any applications that stress the memory mapping and unmapping utility
> (It frequently map and unmap memory)?

Are you looking for real-world applications with this type of load? Or
artificial stress tests? I would not expect to find many of the former
since these are costly operations and there are usually better ways to
do whatever is needed. The latter should be easy to write if needed,
though.

Rich


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

* Re: application frequently map and unmap memory
  2016-08-02 16:18 ` Rich Felker
@ 2016-08-02 16:58   ` Yuxin Ren
  2016-08-02 17:36     ` John Levine
  0 siblings, 1 reply; 4+ messages in thread
From: Yuxin Ren @ 2016-08-02 16:58 UTC (permalink / raw)
  To: musl

I am looking for real-world applications
I guess if some applications use large chunk of memory, map and unmap
are necessary.
I just am not aware which applications have such requirements.

Thanks..

On Tue, Aug 2, 2016 at 12:18 PM, Rich Felker <dalias@libc.org> wrote:
> On Mon, Aug 01, 2016 at 06:06:29PM -0400, Yuxin Ren wrote:
>> Hi all,
>>
>> Are there any applications that stress the memory mapping and unmapping utility
>> (It frequently map and unmap memory)?
>
> Are you looking for real-world applications with this type of load? Or
> artificial stress tests? I would not expect to find many of the former
> since these are costly operations and there are usually better ways to
> do whatever is needed. The latter should be easy to write if needed,
> though.
>
> Rich


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

* Re: application frequently map and unmap memory
  2016-08-02 16:58   ` Yuxin Ren
@ 2016-08-02 17:36     ` John Levine
  0 siblings, 0 replies; 4+ messages in thread
From: John Levine @ 2016-08-02 17:36 UTC (permalink / raw)
  To: musl

In article <CAAKbDrdMVskT=Azgnu6DPUpAbJa_gToUcq-jjCvRKe7CJmJ22g@mail.gmail.com> you write:
>I am looking for real-world applications
>I guess if some applications use large chunk of memory, map and unmap
>are necessary.
>I just am not aware which applications have such requirements.

If you just want to use a large chunk of memory, malloc() and free()
work fine.  Memory mapping is for situtations where you need to share
data between applications, or you want to do something on a whole file
so it's more efficicient to map the file into memory than to use reads
and writes.

My version of grepcidr uses mmap so it can scan through whole files as
fast as possible.  It's like the usual grep utility but specialized to
look for IP addresses, typically in large log files.

http://www.taugh.com/grepcidr-2/

It uses a state machine to scan through each file which never backs up
by more than one character so its usage is map a file, scan through
the whole thing sequentially, unmap it, map in the next file, and so
forth.

R's,
John


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

end of thread, other threads:[~2016-08-02 17:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-01 22:06 application frequently map and unmap memory Yuxin Ren
2016-08-02 16:18 ` Rich Felker
2016-08-02 16:58   ` Yuxin Ren
2016-08-02 17:36     ` John Levine

Code repositories for project(s) associated with this public inbox

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

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