From: Wols Lists <antlists@youngman.org.uk>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Limiting amount of memory a program can use.
Date: Sun, 28 Aug 2022 16:32:00 +0100 [thread overview]
Message-ID: <2895bfbc-5795-5729-69c5-1fd15874d35d@youngman.org.uk> (raw)
In-Reply-To: <CAGfcS_=hVbXr+N6-4ZWiBrWbJUSAmrDJXur+05VG+kK0oO-K8Q@mail.gmail.com>
On 28/08/2022 15:21, Rich Freeman wrote:
> Something I wish linux supported was discardable memory, for
> caches/etc. A program should be able to allocate memory while passing
> a hint to the kernel saying that the memory is discardable.
Linux DOES have that ...
I'm not sure how to use it, but you can pass a flag to open(), which
says "do not cache this file". The obvious use case is something like
cp, but there's plenty of others. Or there are applications which cache
stuff in the app, so don't want to waste OS cache as well - databases
are a prime example.
Apparently not only does memory use crash when this is actively used,
but because the OS does not have to manage cache, speed is actually
noticeably impacted. Given the obsession kernel devs have with not
wasting memory and time, this is likely to be actively maintained and
supported. We just need to find out how to access this from user space.
Cheers,
Wol
next prev parent reply other threads:[~2022-08-28 15:32 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-28 12:24 [gentoo-user] Limiting amount of memory a program can use Dale
2022-08-28 12:56 ` Peter Humphrey
2022-08-28 13:03 ` Michael
2022-08-28 13:10 ` Michael
2022-08-28 14:21 ` Rich Freeman
2022-08-28 15:32 ` Wols Lists [this message]
2022-08-28 21:12 ` Rich Freeman
2022-08-28 14:24 ` Mark Knecht
2022-08-28 16:48 ` ralfconn
2022-08-29 5:50 ` Dale
2022-08-29 16:07 ` Matt Connell
2022-08-29 21:01 ` mad.scientist.at.large
2022-08-29 21:11 ` Dale
2022-08-30 13:56 ` Matt Connell
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=2895bfbc-5795-5729-69c5-1fd15874d35d@youngman.org.uk \
--to=antlists@youngman.org.uk \
--cc=gentoo-user@lists.gentoo.org \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox