Solved

HEAP [example.exe]: "Number of free blocks in arena (69) does not match number in the free lists (68)"

Posted on 2004-09-29
7
687 Views
Last Modified: 2007-12-19
This is a VERY difficult problem were having when we exit the main application in runtime. It does not come up in DEBUG mode. Im using Visual C++ V6 Service Pack 6 under Windows XP Pro.

Error Message: "HEAP:[example.exe] Number of free blocks in arena (69) does not match number in the free lists (68)

When it exits the main application the above error message comes up after it completes the exit instance in the main application.

Has anyone got any ideas what this error means and how to diagnose and fix the problem. The main application is very big.

Many thanks

Mike
0
Comment
Question by:Mike38
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 2

Accepted Solution

by:
carribus earned 168 total points
ID: 12178031
The last time I heard the term "arena" was back in the good old DOS days when one had to know about "arenas" of memory for virtual memory managers and so on. I went and did some reading in the MSDN, and it seems that Windows has 2 different "versions" of memory arenas, specifically one version for Win9x and ME, and another for the NT based Windows (for obvious reasons).

Coming back to your question, I don't have an answer for you, but I do have a few suggestions and queries.

1. In your application, are you performing any 'unusual' memory operations? perhaps dipping down into the metal with a few _asm { } blocks of code?
2. Do you have your own memory manager running in this app? Does it do any Virtual Memory calls during the execution of the app? If yes, make sure that all the calls are terminated correctly and all handles are closed.

Thats about all I can think of. If I find anything else, I'll post.
0
 

Author Comment

by:Mike38
ID: 12178084
Many thanks for the quick reply.

I don't do any unsual memory operations like _asm and I don't use my own memory manager app. I also make sure the calls are terminated correctly and handles closed.

Very strange bug error message.

Mike
0
 
LVL 22

Assisted Solution

by:grg99
grg99 earned 166 total points
ID: 12178469
You're probably zapping some bytes past the end of one of the blocks you allocate.   I'd use some heap debug tool that checks for this.  Or you can roll your own malloc() and free() wrappers that check for this.

0
 
LVL 86

Assisted Solution

by:jkr
jkr earned 166 total points
ID: 12179460
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question