LinuxQuestions.org
Review your favorite Linux distribution.
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-12-2012, 05:24 AM   #1
demon007
LQ Newbie
 
Registered: Sep 2011
Posts: 13

Rep: Reputation: Disabled
Using jemalloc's memory profiler


I am trying to use jemalloc's memory profiler in my code to get the idea of how memory allocation is happening in it.

I have installed jemalloc using the prefix "--enable-prof" but while compiling my code, I was getting undefined reference for "mallctl".

I am not able find which library I have to link to make it work.

Please help me. I am trying this for over three weeks.

Thank You.
 
Old 06-12-2012, 12:32 PM   #2
pan64
Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 5,149

Rep: Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364
I found no documentation about it, but probably you only need to compile with -ljemalloc. But you would give more info to help: what have you tried, what's happened....








__________________________________
Happy with solution ... mark as SOLVED
If someone helps you, or you approve of what's posted, click the "Add to Reputation" button, on the left of the post.
 
Old 06-13-2012, 04:03 AM   #3
demon007
LQ Newbie
 
Registered: Sep 2011
Posts: 13

Original Poster
Rep: Reputation: Disabled
Hi pan64,

thanks for your reply.

I have compiled jemalloc using the option --enabel-prof.

I am trying jemalloc in a small code which is allocating 1GB of memory. I tried to compile the code with -ljemalloc and it is working but the problem is that, it is not creating heap profile of the code.

I require to use the heap profiler that jemalloc has included in it but cant find any documentation regarding how to implement it.
 
Old 06-13-2012, 04:23 AM   #4
pan64
Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 5,149

Rep: Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364
I found no other documentation, just the official one and this: https://bugzilla.mozilla.org/show_bug.cgi?id=627206. Probably it helps. You do not need to implement anything, just switch it on and look at the result.





__________________________________
Happy with solution ... mark as SOLVED
If someone helps you, or you approve of what's posted, click the "Add to Reputation" button, on the left of the post.
 
Old 06-13-2012, 05:08 AM   #5
demon007
LQ Newbie
 
Registered: Sep 2011
Posts: 13

Original Poster
Rep: Reputation: Disabled
Thanks it helped a lot.

And just for the record:
We have to compile jemalloc with --enable-prof.

The code in which jemalloc is to be used has to be compiled with -ljemalloc.

To create heap profiler, execute use the following command:

MALLOC_CONF=prof:true [command in which jemalloc has to be used]
 
Old 06-13-2012, 05:29 AM   #6
pan64
Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 5,149

Rep: Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364
glad to hear that.
Probably you can ask them to release a much better documentation also.





____________________________
If someone helps you, or you approve of what's posted, click the "Add to Reputation" button, on the left of the post.
 
  


Reply

Tags
libraries, memory, profiles


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is pm-profiler ? mrbiomathe Linux - Newbie 1 11-18-2009 11:56 PM
Netbeans Profiler Project manolakis Programming 0 05-19-2009 02:52 PM
Memory profiler ash5 Programming 1 04-07-2009 10:45 PM
Linux System Profiler kazu Linux - Software 3 04-21-2005 01:31 AM
Memory profiler in Linux Franziss Programming 1 02-18-2005 01:29 PM


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