LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-30-2008, 06:44 AM   #1
nano2
Member
 
Registered: May 2007
Posts: 100

Rep: Reputation: 15
Default memory allocator ??


Hi ,

Does any one know what the default memory allocator is on linux -Is it different for each distro ?



Thanks in advance
 
Old 06-30-2008, 09:44 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,356

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Please clarify your qn. Do you mean how to allocate memory in eg C ( malloc() ) or which kernel service allocates memory to processes?
 
Old 07-01-2008, 03:31 AM   #3
nano2
Member
 
Registered: May 2007
Posts: 100

Original Poster
Rep: Reputation: 15
Sorry I meant to say kernel memmory .

In Solaris the memory allocator that's used is libumem which is preloaded .
Is there an equivalent for linux ?
 
Old 07-01-2008, 09:13 PM   #4
synss
Member
 
Registered: Jul 2007
Location: Germany
Distribution: Debian, Gentoo, Mac OS X
Posts: 137

Rep: Reputation: 22
I would say SLAB and SLUB are what you are looking for. You may check on lwn.net for more information if you like.
 
Old 07-02-2008, 03:40 AM   #5
nano2
Member
 
Registered: May 2007
Posts: 100

Original Poster
Rep: Reputation: 15
I am using Redhat 4.5 distro and gcc3.4.6 is the compiler - I don't think this allocator will work for this version of Linux .
 
Old 07-03-2008, 01:25 AM   #6
synss
Member
 
Registered: Jul 2007
Location: Germany
Distribution: Debian, Gentoo, Mac OS X
Posts: 137

Rep: Reputation: 22
hu? SLAB has been there since the 2.4 series at least and was designed around 1994, is it not old enough? What kernel are you using? I probably just did not understand your question, sorry.
 
Old 07-03-2008, 07:05 PM   #7
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,647
Blog Entries: 4

Rep: Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933
As you can see from reading the kernel source, there have been several memory-allocator schemes used in different generations of the kernel. The most-recent one is based on "slabs," which takes full advantage of the fact that kernel memory-allocations usually ask for and release memory blocks of only a few well-known sizes. In other words, if you know that (among other things) you're constantly allocating and releasing blocks of (say...) 148 bytes, it's a very good idea to set-aside a larger chunk of memory (a "slab") just for allocations of that size.

In this way, a particular "slab" basically won't fragment. You don't have to waste a lot of time joining adjacent blocks together. The tradeoff is that you "waste" memory... but these days, "frankly, who cares?" (Memory we got, but microseconds are as precious as ever.)
 
Old 07-04-2008, 04:34 AM   #8
nano2
Member
 
Registered: May 2007
Posts: 100

Original Poster
Rep: Reputation: 15
the version of the kernel is 2.6.9-55.EL
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference between resident memory,shared memory and virtual memory in system monitor mathimca05 Linux - Newbie 1 11-11-2007 04:05 AM
LXer: Anatomy of the Linux Slab Allocator LXer Syndicated Linux News 0 05-16-2007 03:46 PM
Details about default web Browser & default Email client sudhasmyle Linux - Software 4 06-15-2006 11:45 AM
feature request: high memory kernel (up to 4GB) as default patfins Slackware 30 04-30-2006 09:09 PM
Help!?! RH 8 Memory Mapping -High Memory-Virtural Memory issues.. Merlin53 Linux - Hardware 2 06-18-2003 04:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration