LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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-12-2012, 04: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, 11:32 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,838

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
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, 03: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, 03:23 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,838

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
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, 04: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, 04:29 AM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,838

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
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



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 10:56 PM
Netbeans Profiler Project manolakis Programming 0 05-19-2009 01:52 PM
Memory profiler ash5 Programming 1 04-07-2009 09:45 PM
Linux System Profiler kazu Linux - Software 3 04-21-2005 12:31 AM
Memory profiler in Linux Franziss Programming 1 02-18-2005 12:29 PM

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

All times are GMT -5. The time now is 06:48 PM.

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