nanogui: static const fonts


Previous by date: 6 Jul 2004 22:20:22 +0100 Re: getting rid of create_font message, tj
Next by date: 6 Jul 2004 22:20:22 +0100 Re: static const fonts, Alan Cox
Previous in thread:
Next in thread: 6 Jul 2004 22:20:22 +0100 Re: static const fonts, Alan Cox

Subject: static const fonts
From: David Muse ####@####.####
Date: 6 Jul 2004 22:20:22 +0100
Message-Id: <20040706172009.0416d427.dmuse@4accesscommunications.com>

Hello,

I've been analyzing the memory usage of my applications recently and I noticed that libmwfonts.so appears to have a rather large, writable data segment. 

"cat /proc/<pid>/maps | grep libmwfonts" shows:

401d4000-401d5000 r-xp 00000000 1f:03 450        /usr/local/4access/lib/libmwfoo
401dc000-401ea000 rw-p 00000000 1f:03 450        /usr/local/4access/lib/libmwfoo

The second segment is about 56k.

"size libmwfonts.so" shows:

   text    data     bss     dec     hex filename
   2404   52432      28   54864    d650 libmwfonts.so

The data segment is about 51k here, rounded up to a page boundary would be about 52k.  So about 52k of that writable data segment is initialized data.

convbdf.c appears to be generating regular arrays instead of const arrays.  Modifying convbdf.c to output const arrays results in the initialized data going into the text section rather than the data section.

Does this matter?  Can writable data segments be shared between processes?  Are they copied into the address space of each process?  Are they only copied if they are written to?

I've been attempting to reduce the amount of ram that my apps use and I've had a difficult time finding any information on the web about how to profile memory usage and what kinds of things one can do to reduce it.  I've pretty much been digging through /proc/<pid> manually and doing a lot of trial and error testing.  So far, it appears that reducing the size of a library's data segment helps, but I'm not 100% clear on the details yet.  If anyone out there knows much about this subject, I'd appreciate any help you can give me.

Thanks,

David Muse
####@####.####

Previous by date: 6 Jul 2004 22:20:22 +0100 Re: getting rid of create_font message, tj
Next by date: 6 Jul 2004 22:20:22 +0100 Re: static const fonts, Alan Cox
Previous in thread:
Next in thread: 6 Jul 2004 22:20:22 +0100 Re: static const fonts, Alan Cox


Powered by ezmlm-browse 0.20.