LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 07-04-2012, 10:07 AM   #1
Snark1994
Senior Member
 
Registered: Sep 2010
Location: Wales, UK
Distribution: Arch
Posts: 1,632
Blog Entries: 3

Rep: Reputation: 345Reputation: 345Reputation: 345Reputation: 345
Speed issues with GLUT and Valgrind


I've written a 3D program using GLUT and wanted to check for memory leaks with Valgrind. However, when I run

Code:
valgrind --tool=memcheck myProgram
it takes over 2 minutes for the window to display anything, and then everything runs slowly - whereas when run normally everything is fine.

I appreciate valgrind is doing Wizzardry behind the scenes for me, but is there any way of getting it to do it... a bit faster?

EDIT: the 2 minute figure I quoted is inaccurate, it actually turns out my window manager (xmonad) is playing silly buggers with the window, and only displays the content if you e.g. retile the workspace, or move the window to a different workspace. However, the speed problem still persists...

Thanks in advance,

Last edited by Snark1994; 07-04-2012 at 10:30 AM.
 
Old 07-07-2012, 12:27 AM   #2
tuxdev
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 2,014

Rep: Reputation: 115Reputation: 115
If you're using GLUT, I assume it's some kind of game or other heavy multimedia thing. That's gonna be slow no matter what.
 
Old 07-07-2012, 11:00 AM   #3
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian
Posts: 2,489

Rep: Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850
DrMemory claims to run faster than valgrind. Also you could try eliding the actual OpenGL rendering calls, on the assumption that the OpenGL implementation doesn't leak.
 
Old 07-08-2012, 08:20 AM   #4
Snark1994
Senior Member
 
Registered: Sep 2010
Location: Wales, UK
Distribution: Arch
Posts: 1,632
Blog Entries: 3

Original Poster
Rep: Reputation: 345Reputation: 345Reputation: 345Reputation: 345
Hm, yeah, good suggestion, though unfortunately as tuxdev suggested it is a game, so relies on user interaction. Perhaps I could script actions to be carried out automatically and then do the same. Thanks for the suggestions I'll provisionally mark it as solved, but would still welcome any suggestions!
 
Old 07-08-2012, 11:53 AM   #5
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian
Posts: 2,489

Rep: Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850
Quote:
Originally Posted by Snark1994 View Post
Hm, yeah, good suggestion, though unfortunately as tuxdev suggested it is a game, so relies on user interaction.
Well, you could skip just some of the opengl calls, eg just draw wire-frames.

You might also try using the Boehm GC as a leak detector. I expect that would be faster than both valgrind and drmemory, since it isn't checking for memory corruption. In fact, you may not notice any performance loss at all. Of course, if you actually do have memory corruption it won't help you...
 
Old 07-09-2012, 04:35 AM   #6
Snark1994
Senior Member
 
Registered: Sep 2010
Location: Wales, UK
Distribution: Arch
Posts: 1,632
Blog Entries: 3

Original Poster
Rep: Reputation: 345Reputation: 345Reputation: 345Reputation: 345
Quote:
Originally Posted by ntubski View Post
Well, you could skip just some of the opengl calls, eg just draw wire-frames.
You flatter me with your assumption that I'm drawing anything which isn't a wireframe... :P

Quote:
You might also try using the Boehm GC as a leak detector.
Thanks, I'll look into it
 
  


Reply

Tags
glut, opengl, speed, valgrind


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
Network card speed issues Xi0N Linux - Hardware 1 03-21-2010 03:31 PM
k3b speed issues ganja_guru Linux - Software 5 03-31-2005 07:04 PM
ADSL Speed issues turls Linux - Networking 2 12-14-2003 02:25 PM
Internet speed issues riant Linux - Networking 1 07-09-2003 05:16 PM
Apache Speed Issues contiga Linux - Software 13 07-19-2002 05:21 PM


All times are GMT -5. The time now is 03:39 AM.

Main Menu
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