Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 553193 - Locales are using large mmap-ed file /usr/lib/locale/locale-archive
Summary: Locales are using large mmap-ed file /usr/lib/locale/locale-archive
Keywords:
Status: CLOSED DUPLICATE of bug 541911
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Andreas Schwab
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-01-07 11:27 UTC by Zdenek Kabelac
Modified: 2010-02-24 19:33 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-02-24 19:33:16 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Zdenek Kabelac 2010-01-07 11:27:57 UTC
Description of problem:

For majority of application using mmap-ed file is actually not a problem as only tiny fraction of such file takes some memory (i.e.. typically in range of tens KB)

However problem is, when application wants to lock itself in memory.

Please check the original problem in bug 541911.  

If the application uses mlockall() then whole 100MB file (on my current rawhide distro) gets mmaped to memory and eats memory if some locales are set for such application.

Current solution for dmeventd is to either not setup locales inside the application or to switch them to plain C before application startup (as after all the binary itself is not really localized at this moment anyway)

But this effectively makes any application that wants to use mlockall() (for whatever reason) hardly 'localizable' - as locking 100MB of mostly junk into system memory is not really a good option in this case.

I'm not really sure what is the right solution here:

- maybe split the locale-archive to smaller files per language ?
- eventually at least support selectable locales for whole system, so the file has only locales which makes sense on given system - thus file is much much smaller ?
- or leave the current status and mark program that uses mlockall() non-localizable ?

Version-Release number of selected component (if applicable):
glibc-common-2.11.90-4.x86_64

How reproducible:


Steps to Reproduce:
1. use dmeventd (device-mapper-event-1.02.38-2.fc12.x86_64) with some locales 
2.
3.
  
Actual results:
lots of resident memory taken by mlocked /usr/lib/locale/locale-archive

Expected results:


Additional info:

Comment 1 Andreas Schwab 2010-01-11 13:28:12 UTC
Just remove that file, and setlocale will use the normal locale files.

Comment 2 Zdenek Kabelac 2010-01-11 13:41:12 UTC
Well - as I mentioned above - easiest way is to startup the application with LANG=C. However this bugzilla is rather about some 'global' solution.

So are you proposing user should go to /usr/lib/locale and manually cleanup regenerated locale-archive wherever they notice the binary in memory uses to much memory ?

Comment 3 Juan Quintela 2010-02-24 19:29:26 UTC
Any news on this problem?  I have to do

vgchange --monitor n
killall -9 dmeventd
LC_ALL=C vgchange --monitor y

If real problem is difficult to fix, it is easy to "workaround" it callingvgchange with LC_ALL=C everwhere.

Comment 4 Juan Quintela 2010-02-24 19:33:16 UTC
Closing this bug as duplicated of #541911.

(Information on both was similar, and the other is older).  They refer to the same bug.

*** This bug has been marked as a duplicate of bug 541911 ***


Note You need to log in before you can comment on or make changes to this bug.