From: Zdenek Kabelac <zkabelac@redhat.com>
To: lvm-devel@redhat.com
Subject: lvm and locales memory issue
Date: Mon, 22 Feb 2010 11:55:30 +0100 [thread overview]
Message-ID: <4B8262A2.4050408@redhat.com> (raw)
In-Reply-To: <20100219163008.GR27427@agk-dp.fab.redhat.com>
On 19.2.2010 17:30, Alasdair G Kergon wrote:
> On Fri, Feb 19, 2010 at 05:11:09PM +0100, Zdenek Kabelac wrote:
>> Jakub suggest solution to use a tiny small forked() process with very limited
>> funcionality to handle mlockall() task without any usage of locales.
>
> Nack. It's not tiny - it's most of the code - and it's a *state* of usage of
> the code - a way of using the *same* code as we also use without mlockall at
> other times - the code knows to behave slightly differently depending whether
> or not it is in this state.
>
> Surely most people don't need most of the locales - they should be able to
> choose which ones to cache in the archive file - the ones they regularly use -
> and take the performance hit on the occasions (if any) they want to use the
> non-cached ones.
>
> I notice the code to build the archive is in a 'fedora' subdir in the spec file
> with hard-coded pathnames. Is there an 'upstream' approach here or do different
> distributions handle this differently and if so why?
>
>> Eventually error reports, debugs and other things should be handled in
>> surrounding environment - just like we have discussed already as a one
>> potential solution.
>
> Opposite way around. The hack would be to push all the things that attempt to
> access that locale archive file out into a subprocess. That would first require
> an audit of all the the glibc functions we use to determine which ones can attempt
> to access that file. Then we'd have to place wrappers around those functions
> to push them into a subprocess and avoid using them synchronously when in this
> 'mlocked'
state.
>
Here is outcome of another chat with Jakub:
It looks like there is no easy way to modify API of glibc anytime soon in the
near future and this change would have to go through Uli first...
(there seems to be things like 'newlocale()' which make things more complicated)
As the workaround for 'memory-limited' environments here is suggested workadound.
remove cache file:
'rm -f /usr/lib/locale/locale-archive'
and create just locales you need to use:
'localedef -f UTF-8 -i cs_CZ /usr/lib/locale/cs_CZ.utf8'
(In this case small separate files in the directory:
"/usr/lib/locale/cs_CZ.utf8" are create and opened during application runtime
- this is probably less effiecient then this second way:
or eventually recreate /usr/lib/locale/locale-archive with this command:
'localedef -i cs_CZ -c -f UTF-8 -A /usr/share/locale/locale.alias cs_CZ.UTF-8'
(In this case only .5MB file is generated - for adding another locales - just
another call with localedef is needed - i.e. en_US, de_DE, cs_CZ will lead to
~3MB files at my current installation.
Memory footprint for just cs_CZ test case is - i.e. main() { setlocale();
mloockall{} } is approximately 4MB - compared to 100MB with normal - full
locale-archive.
Zdenek
next prev parent reply other threads:[~2010-02-22 10:55 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-18 9:19 lvm and locales memory issue Zdenek Kabelac
2010-02-18 12:48 ` Milan Broz
2010-02-18 13:26 ` Zdenek Kabelac
2010-02-19 16:11 ` Zdenek Kabelac
2010-02-19 16:30 ` Alasdair G Kergon
2010-02-22 10:55 ` Zdenek Kabelac [this message]
2010-02-22 13:16 ` Zdenek Kabelac
2010-02-22 18:11 ` Alasdair G Kergon
2010-02-22 18:23 ` Jakub Jelinek
2010-02-22 18:51 ` Alasdair G Kergon
2010-02-22 19:05 ` Jakub Jelinek
2010-02-23 8:52 ` Zdenek Kabelac
2010-02-23 9:15 ` Jakub Jelinek
2010-02-23 9:14 ` Zdenek Kabelac
2010-02-23 9:45 ` Jakub Jelinek
2010-02-23 10:12 ` Zdenek Kabelac
2010-02-23 13:07 ` Zdenek Kabelac
2010-02-23 15:17 ` Zdenek Kabelac
2010-02-23 16:28 ` Jakub Jelinek
2010-02-23 16:53 ` Alasdair G Kergon
2010-02-23 16:56 ` Zdenek Kabelac
2010-02-24 9:39 ` Zdenek Kabelac
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=4B8262A2.4050408@redhat.com \
--to=zkabelac@redhat.com \
--cc=lvm-devel@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.