Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

"Segmentation fault" while running code, how can I increase the stack size?

Hi, I only have very limited knowledge about c+ codes and compiling them and I would be very happy if someone can assist me.

My problem: I have two c++ codes, one with an array size of ~100,000, the other with ~1,500,000. When I compile them using terminal g++ -o commands, the smaller one works with no problem (it takes less than a minute to run), the larger one gives "Segmentation fault". I think it is a memory allocation problem and I am not an expert on dynamic memory allocation which I want to avoid for now.

My question: When I compile the large code in Windows Visual Basic, I can go to settings to increase the stack and heap sizes and it does work. Is there a similar thing in OS X Leopard? I found some commands to do that in the terminal window but I wasn't able to resolve my problem.

Thanks for all your help.

13" MacBook, Mac OS X (10.5.6), 2.2 Ghz Intel Core 2 Duo 2GB 667 Mhz DDR2 SDRAM

Posted on Aug 24, 2009 10:00 PM

Reply
Question marked as Best reply

Posted on Aug 24, 2009 10:08 PM

Try the Developer forums.
2 replies

"Segmentation fault" while running code, how can I increase the stack size?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.