encyclopegia.org

Debug new

Debug_new refers to a technique in C++ to overload and/or redefine operator new and operator delete in order to intercept the memory allocation and deallocation calls, and thus debug a program for memory usage. It often involves defining a macro named DEBUG_NEW, and makes new become something like new(__FILE__, __LINE__) to record the file/line information on allocation. Microsoft Visual C++ uses this technique in its Microsoft Foundation Classes. There are some ways to extend this method to avoid using macro redefinition while still able to display the file/line information on some platforms. There are many inherent limitations to this method. It applies only to C++, and cannot catch memory leaks by C functions like malloc. However, it can be very simple to use and also very fast, when compared to some more complete memory debugger solutions.

Debug_new refers to a technique in C++ to overload and/or redefine operator new and operator delete in order to intercept the memory allocation and deallocation calls, and thus debug a program for memory usage. It often involves defining a macro named DEBUG_NEW, and makes new become something like new(__FILE__, __LINE__) to record the file/line information on allocation. Microsoft Visual C++ uses this technique in its Microsoft Foundation Classes. There are some ways to extend this method to avoid using macro redefinition while still able to display the file/line information on some platforms. There are many inherent limitations to this method. It applies only to C++, and cannot catch memory leaks by C functions like malloc. However, it can be very simple to use and also very fast, when compared to some more complete memory debugger solutions. ==See also== Memory debugger ==External links== A Cross-Platform Memory Leak Detector DEBUG_NEW (MFC)

References

No reference rows published for this article.

Cite this article

MLA

"Debug new." encyclopegia.org, 2022, https://encyclopegia.org/wiki/debug-new. Accessed 24 November 2026.

Chicago

"Debug new." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/debug-new.

APA

encyclopegia.org. (2022). Debug new. Retrieved November 24, 2026, from https://encyclopegia.org/wiki/debug-new

Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

Troy Haymakers

enwiki · references available

Candiru (fish)

enwiki · references available

List of curling clubs in the United States

enwiki · references available

Arthur Holmwood

enwiki · references available

I'm with Her (TV series)

enwiki · references available

Great North Road, Auckland

enwiki · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1064339077 · 0.5 · snapshot enwiki-001064339077

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.