Steve deRosier
2013-04-12 14:34:19 UTC
Hi all,
Every time our application mallocs any small number of bytes (<8k),
the device seems to malloc an entire page (8k). Does anyone know why
this happens, and how I can fix it?
Full details:
This same application ran fine on a Linux 2.4.x (uClinux) platform,
but due to various reasons we've had to upgrade the platform to 3.3.0
(still uClinux). Coldfire mcf5235, 4 MB flash, 32 MB RAM. We're using
uClibc.
At the time we start the application, there is ~20 MB free, it runs
for 30+ seconds and then the OOM killer kills it. On the 2.4.x
platform, it has a high-water-mark of about 2 MB, and runs in the
steady-state at about 1.5 MB.
After much investigation (eventually culminating in a debug version of
malloc printing each allocation request, then sleeping for 2 seconds,
where I cat /proc/meminfo), we finally noticed that each allocation,
typically 10-40 bytes, reduces meminfos's MemFree by 8k.
Other than the underlying kernel and wholesale upgrade of the uClinux
base, nothing has really changed on the system. We're still selecting
the same packages and configuration as near as possible.
Thanks,
- Steve
Every time our application mallocs any small number of bytes (<8k),
the device seems to malloc an entire page (8k). Does anyone know why
this happens, and how I can fix it?
Full details:
This same application ran fine on a Linux 2.4.x (uClinux) platform,
but due to various reasons we've had to upgrade the platform to 3.3.0
(still uClinux). Coldfire mcf5235, 4 MB flash, 32 MB RAM. We're using
uClibc.
At the time we start the application, there is ~20 MB free, it runs
for 30+ seconds and then the OOM killer kills it. On the 2.4.x
platform, it has a high-water-mark of about 2 MB, and runs in the
steady-state at about 1.5 MB.
After much investigation (eventually culminating in a debug version of
malloc printing each allocation request, then sleeping for 2 seconds,
where I cat /proc/meminfo), we finally noticed that each allocation,
typically 10-40 bytes, reduces meminfos's MemFree by 8k.
Other than the underlying kernel and wholesale upgrade of the uClinux
base, nothing has really changed on the system. We're still selecting
the same packages and configuration as near as possible.
Thanks,
- Steve