LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 04-21-2010, 11:03 PM   #1
chamara82
LQ Newbie
 
Registered: Apr 2010
Posts: 6

Rep: Reputation: 0
Does linux do fragmentation on virtual address space?


I have millions of small chunks of new's and delete's in my program. Even though no memory leak is detected through valgrind or purify, memory grows. But the growth is degrading over the number of times of the execution of the tasks. Can i think that fragmentation plays a role in this?
 
Old 04-21-2010, 11:10 PM   #2
paulsm4
Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
No.

If memory is growing monotonically as the program continues to execute, then you've probably got a leak.

IMHO .. PSM
 
Old 04-22-2010, 02:45 AM   #3
chamara82
LQ Newbie
 
Registered: Apr 2010
Posts: 6

Original Poster
Rep: Reputation: 0
But valgrind and purify gave 0 memory leaks. So fragmentaion is not happening in LINUX?
 
Old 04-22-2010, 03:09 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,491

Rep: Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077
Quote:
Originally Posted by chamara82 View Post
Even though no memory leak is detected through valgrind or purify, memory grows. But the growth is degrading over the number of times of the execution of the tasks. Can i think that fragmentation plays a role in this?
Explain this a little. How are you determining there is memory growth. With large numbers of allocations, the slab allocator has been know to cause symptoms like this, but that has been corrected in more recent kernels.
What kernel are you on ?.
Each time you check your memory usage, do this as well to see if this is impacting you at a similar rate
Code:
grep ^Slab /proc/meminfo
 
Old 04-22-2010, 05:47 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,491

Rep: Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077
How a look at this thread as well.
Might be a language problem rather than the O/S.
 
Old 04-23-2010, 01:34 AM   #6
chamara82
LQ Newbie
 
Registered: Apr 2010
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks syg00 for the faster response. Kernel version --> 2.6.9-67
It seems that slab memory doesn't change much when the execution occurs. The growth is shown in
VIRT (using top)
 
Old 04-23-2010, 10:51 AM   #7
paulsm4
Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Chamara -

Q: Did you read the recommended post?

Q: Did you try the Hoard memory allocated yet? Did a make a difference.

The main thing is:
* Valgrind, Purify, Electric Fence and friends can all be VERY useful in finding a problem

* Unfortunately, sometimes you get "false positives": it flags issues that aren't really problems.

* Worse, the tools can also FAIL to find REAL problems. Which might well be the case here.

So be skeptical.

Regardless of what the tool says, *double check* your own code. Or better still, write test cases to verify your algorithms.

IMHO .. PSM
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Application Virtual address space memory allocation - memory does not get free chamara82 Linux - General 4 01-01-2011 09:19 PM
how to translate virtual address to physical address in linux application saurin Programming 1 11-18-2009 10:05 PM
virtual address space question mokku Linux - Newbie 2 11-06-2007 09:18 PM
get the virtual address of I/O Space stz Programming 1 11-02-2006 11:44 AM
Increasing virtual address space mhl Linux - Newbie 1 09-07-2005 11:29 AM


All times are GMT -5. The time now is 09:22 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration