LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-10-2010, 11:03 PM   #1
kcynice
Member
 
Registered: Sep 2008
Distribution: Slackware
Posts: 154

Rep: Reputation: 25
Question How to release glib's slab memory allocator(in gslice.c)?


I have a question about glib's slab memory management. There, if i use g_node_new to create a new GNode object, it will initialize the allocator and then allocate some memory usage for it. But, if g_node_destory was called, only chunks managed by the allocator was returned to the slab pool and can be reused by further usage by glib slab manager, but can't be used by other allocator.(In another word, if i only call g_node_new and then call g_node_destory would insult to some memory leak!). If one program only use glib to manage its memory, it's ok. But, how about not? If not, some memory would be reserved by glib slab allocators although it's not used by any usage. So, as long as the program running, it would fail to allocate more memory in future(If not by glib).
So, I want to release the slab allocators if the job completed.What should i do? And is there a function doing some cleanup job?
Thanks.

Last edited by kcynice; 06-10-2010 at 11:05 PM.
 
  


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
looking for a fast STL-compliant memory-pool allocator ta0kira Programming 1 03-26-2009 04:02 PM
Default memory allocator ?? nano2 Linux - Software 7 07-04-2008 04:34 AM
LXer: Anatomy of the Linux Slab Allocator LXer Syndicated Linux News 0 05-16-2007 03:46 PM
is It pocible to have installed two or more GLIB's version and select of some form??? pipebkn Linux - Software 3 03-25-2005 10:14 PM
How do you release memory? Paul12 Linux - General 1 08-22-2001 04:02 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:56 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