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 07-31-2007, 11:24 PM   #1
rajat
LQ Newbie
 
Registered: Jan 2007
Posts: 20

Rep: Reputation: 0
How to increase Heap Size?


Hi Folks!

I'm facing lot of segmentation faults in my code. I tried using some memory debugger like valgrind but all in vain as they may my application a lot slower and due to which my application does not work at all. And so I'm not able to debug my code.

I'm thinking of increasing the Heap Size of system which is a Fedora Core 6, kernel 2.6.18
Please suggest is this a wise idea to increase the heap when there is problem debugging the code?

Also, suggest how can I increase the Heap Size of my machine?

Thanks and Regards,
Rajat
 
Old 08-01-2007, 06:33 AM   #2
wjevans_7d1@yahoo.co
Member
 
Registered: Jun 2006
Location: Mariposa
Distribution: Slackware 9.1
Posts: 938

Rep: Reputation: 31
The heap grows dynamically as you allocate memory. Every time you do a malloc(), if it is not using memory you have previously released using free(), your program is using memory at the end of your heap. When your program runs out of memory at the end of your heap, the heap grows.

At any rate, even manually increasing the heap size will not cause your bug to be fixed. Don't try to just make the error messages go away. Find the root cause of the problem.

If valgrind and electric fence make your program run much slower, then I can't think of any other solution than debugging the old-fashioned way: make a test copy of the source, and find out how much of the source you can pull out without making the problem go away.

Then play with that minimal broken program. Pull individual pieces out of it and learn how that makes the program's behavior change.

This will not be easy. The yellow brick road ahead of you is a long, hard yellow brick road.

Hope this helps.
 
  


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
Increase Partition Size shane200_ Linux - Hardware 1 08-24-2006 12:06 PM
increase harddisk size.... yenonn Linux - General 1 10-14-2005 09:57 AM
Find out heap size for a PID luexiong Linux - General 1 03-29-2005 09:40 AM
increasing heap size podollb Linux - Software 3 03-06-2005 11:42 PM
increase point size size when printing PDF files newlin Red Hat 0 09-27-2003 07:13 AM

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

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