Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Comments
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

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?
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900