Click here to Skip to main content
11,927,440 members (42,819 online)
Rate this:
Please Sign up or sign in to vote.
See more: C memory
I am calling a function recursively and which is allocating 2048 byte is being allocated in each call.At start the application is running as per requirement but later it is getting crashed by giving the error that "Not enough storage is available to process this command". And the memory allocator returns bad pointer of memory,for which the application is being crashed.can any one please help me on this issue.
Posted 17-Apr-12 0:34am
Keith Barrow 17-Apr-12 5:50am
Please add some code. Obviously you are recursing so often that the memory is used up. Whether this should happen, and what can be done about it largely depends on what you are doing.
Roliking 17-Apr-12 5:54am
please add your code..

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

There are a couple of possibilities, the major ones are
1) Your recursive routine is being called too deep.
2) Your routine is not releasing memory when it is finished with it.
3) Your routine is allocating more memory than you think.
4) Your heap size is set too small.

The first three you may be able to fix by looking at your code. The last one you may be able to fix by increasing the size of the heap - but how you can do that (if you can) depends on the compilation system you use.

Have you checked how many calls there are to this routine?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.151126.1 | Last Updated 17 Apr 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100