memory leakage

J

Jack Klein

please give me the solution for the problem of memory leakage.

Coat your memory with epoxy, then caulk with a good quality
silicon-based compound. It will never leak again.
 
J

John Harrison

madhawi said:
please give me the solution for the problem of memory leakage.

Code it properly in the first, this means avoid the direct use of
pointers to heap allocated memory, use std:vector, std::string etc.
instead. If you must use pointers, wrap them up well inside a class and
check the class carefully.

If you have legacy code which uses pointers and has a leak, them use a
leak detection tool. There are many on the market.

john
 
K

Kai-Uwe Bux

madhawi said:
please give me the solution for the problem of memory leakage.

Write code that does not leak.

On a more serious note: you phrased the question as though there was a
single problem of memory leakage and there would be a uniform solution to
that problem (aka silver bullet). However, that is a missleading
perspective. There are many different problems that can result in code
leaking memory; and different means have to be used to cure those problems.
There is no silver bullet.

If you want more meaningful answers to your question, you need to be more
specific. Do you have a concrete piece of code at hand whose leaks need
fixing?


Best

Kai-Uwe Bux
 
M

Marcus Kwok

madhawi said:
please give me the solution for the problem of memory leakage.

There is no general solution. However, there are techniques that can
help reduce the likelihood of them occurring, such as RAII, smart
pointers, and garbage collection. Whether or not to use any of these
techniques (or even something else) will probably depend on the specific
context.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top