[apparmor] [PATCH] cleanup followpos

Steve Beattie sbeattie at ubuntu.com
Fri Jul 9 02:57:53 BST 2010


On Thu, Jul 08, 2010 at 06:06:56PM -0700, Steve Beattie wrote:
> On Wed, Jul 07, 2010 at 11:14:33AM -0700, John Johansen wrote:
> > On 07/07/2010 10:51 AM, John Johansen wrote:
> > > When creating the dfa the sets firstpos, lastpos, and followpos are computed for
> > > each expression tree node and then used as input to create the dfa states.
> > > 
> > > Currently they are not being freed until the nodes are destroyed, but the information
> > > is no longer needed once the dfa has been created.  Cleaning them up early reduces
> > > peak memory usage.
> > > 
> > I would like to nominate this patch for 2.5.1 as it helps reduce memory usage
> 
> ACK from me for both, please commit to trunk so I can pull onto the
> 2.5.1 branch.

Though putzing around with this patch applied under valgrind actually
appears to cause more memory to be used over the lifetime of the
process, roughly 150KB on ubuntu 10.04/amd64 against the shipped
evince profile (168,126,893 bytes without patch, 168,277,737 with).
However, more deallocations are done and the amount in use at exit is
reduced. I still think this is okay.

(Is there a way to measure a high water mark of a process' memory
usage?)

-- 
Steve Beattie
<sbeattie at ubuntu.com>
http://NxNW.org/~steve/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
Url : https://lists.ubuntu.com/archives/apparmor/attachments/20100708/a4eed27d/attachment.pgp 


More information about the AppArmor mailing list