Bug 6817 - bitbake build of core-image-minimal appears to leak memory
Summary: bitbake build of core-image-minimal appears to leak memory
Status: RESOLVED NOTABUG
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Undecided normal
Target Milestone: ---
Assignee: Richard Purdie
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2014-10-07 17:24 UTC by Steve Maynard
Modified: 2014-10-09 15:17 UTC (History)
3 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Maynard 2014-10-07 17:24:22 UTC
Bitbake appears to leak memory.

bitbake --version
BitBake Build Tool Core version 1.22.0, bitbake version 1.22.0

uname -a
Linux jupiter 3.8.0-44-generic #66~precise1-Ubuntu SMP Tue Jul 15 04:01:04 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 12.04.5 LTS
Release:	12.04
Codename:	precise

top
top - 10:32:22 up 30 min,  2 users,  load average: 0.08, 0.08, 0.14
Tasks: 243 total,   1 running, 242 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.2%us,  0.1%sy,  0.0%ni, 99.7%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:  32904260k total,  1367656k used, 31536604k free,    72956k buffers
Swap: 33510396k total,        0k used, 33510396k free,   537656k cached
====== snip ======

cd ~/poky

MACHINE=qemuarm source oe-init-build-env

MACHINE=qemuarm bitbake core-image-minimal

top
top - 11:11:00 up  1:09,  2 users,  load average: 0.24, 4.53, 6.98
Tasks: 241 total,   1 running, 240 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.2%us,  0.1%sy,  0.0%ni, 99.5%id,  0.1%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:  32904260k total, 16689968k used, 16214292k free,   728104k buffers
Swap: 33510396k total,        0k used, 33510396k free, 14000708k cached
====== snip ======
Comment 1 Steve Maynard 2014-10-07 19:07:35 UTC
Verified on second machine for default machine qemux86:

bitbake --version
BitBake Build Tool Core version 1.23.1, bitbake version 1.23.1

uname -a
Linux ganymede 3.11.0-26-generic #45~precise1-Ubuntu SMP Tue Jul 15 04:02:35 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 12.04.5 LTS
Release:	12.04
Codename:	precise

top
top - 11:50:20 up 10:14,  3 users,  load average: 1.07, 0.71, 0.32
Tasks: 244 total,   1 running, 243 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.3%us,  0.1%sy,  0.0%ni, 99.6%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:  12287936k total,  3490292k used,  8797644k free,  1163580k buffers
Swap:  8386556k total,        0k used,  8386556k free,   845224k cached

source oe-init-build-env
bitbake core-image-minimal

top
top - 13:02:10 up 11:26,  3 users,  load average: 0.94, 2.38, 5.51
Tasks: 245 total,   1 running, 244 sleeping,   0 stopped,   0 zombie
Cpu(s):  1.0%us,  0.2%sy,  0.0%ni, 98.7%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:  12287936k total, 11665488k used,   622448k free,   426320k buffers
Swap:  8386556k total,    37116k used,  8349440k free,  9030708k cached
Comment 2 Ross Burton 2014-10-09 15:17:33 UTC
I'm assuming that you're running top before and after a bitbake run, in which case the relevant lines are:

Before bitbake:
Mem:  32904260k total,  1367656k used, 31536604k free,    72956k buffers

After bitbake:
Mem:  32904260k total, 16689968k used, 16214292k free,   728104k buffers

The increase in "used" is caused by the disk cache ("buffers") being 730M instead of 73M, as you've just done a bitbake build which causes large amounts of disk I/O.  If the system needs more memory then the caches will be dropped to free up memory.  This is expected and desired behaviour from the kernel.