Memory allocator change
When running a userspace program, the kernel has to allocate a continuous block of memory to store the code, data and stack.
The default memory allocator in the 2.6 branch of the linux kernel is called SLAB.
The SLAB allocator rounds this allocation up to the next size it deals with.
The SLAB allocator uses sizes of 32, 64, 96, 128, 192, 256 and 512 bytes and 1, 2, 4, 8, 16, 32, 64, 128, 256, 512 and 1024 kilobytes.
So if a program requires 70k of memory, the SLAB allocator would allocate 128k.
This wastes a lot of memory.
There is an alternative memory allocator called SLOB.
SLOB allocates what you ask for and doesn’t waste memory.
The SLOB allocator has been added to DSLinux and will be used in the next nightly build.
Using SLOB will allow retawq to run on the GBAMP build again.
April 17th, 2006 at 1:03 pm
Cool. This will optimize memory usage in all builds?
*Bad Pun Warinng*
It seems in this case that “SLAB” really is the SLOB here. :p
April 17th, 2006 at 1:11 pm
Never thought this kind of scheduler is a default in uClinux! Thanks for the hint, I’ll try using SLOB on a router where I constantly have “out of memory” issues.
Dslinux is really having a sprint now XIP is implemented!
April 17th, 2006 at 1:45 pm
Good call
.
Shaves off a lot of memory usidge.
Not that I have any use for it a.t.m., since I still can’t acces my router with WEP, but this will also create more memory for nano I gues.
April 17th, 2006 at 2:45 pm
LinuxTiny is the collection of the patches to reduce the system size and memory consumption of the Kernel.
http://www.celinuxforum.org/CelfPubWiki/JapanTechnicalJamboree3?action=AttachFile&do=get&target=linutiny_celfJtechJ3_en.pdf
Worth a read?
April 17th, 2006 at 2:53 pm
http://tree.celinuxforum.org/CelfPubWiki Worth reading aswell
April 18th, 2006 at 12:25 am
Why exactly would a 70k program allocate 128k when 96k is the next highest?
April 18th, 2006 at 1:36 am
AndrewNeo: I think that’s 96 bytes as opposed to 96k.
April 18th, 2006 at 10:56 am
AndrewNeo: dont think about it
April 18th, 2006 at 10:57 am
figured it out.
theres 96 bytes, not 96 kilobytes.
he said if it required 70 kilobytes not bytes
April 19th, 2006 at 1:20 am
AndrewNeo:
The SLAB allocator uses sizes of 32, 64, 96, 128, 192, 256 and 512 BYTES!
1, 2, 4, 8, 16, 32, 64, 128, 256, 512 and 1024 KiloBytes.
lol,
see if it was in bytes it would be 96, but its in KB so its 128
:P
miss read man