Browse DevX
Sign up for e-mail newsletters from DevX

Search the Tips
Tip Bank > C++ > Memory Management

Memory Management

1-20 of 87     Previous     Next
Solving Eclipse (Ganymede) and PermGem Out-of-Memory Errors
by Leonard Anghel
If your Eclipse (Ganymede) installation with PermGem is raising out-of-memory errors, here's a possible solution.
Avoiding Unnecessary Object Construction
by Budi Bong
One way to avoid unnecessary object construction is to use a reference instead of an object to store the unnamed temporary object returned by value.
How to Calculate the Alignment in C++
by Alexander Ocher
Learn how to use the Alignment class to calculate alignment in C++.
Using the SecureString Class
by Srinath MS
NET 2.0's System.Security namespace includes the SecureString class, which lets you create encrypted strings and delete them from memory when they're no longer needed.
Avoid Memory Corruption when Assigning a CComBSTR to a CComVariant's bstrVal Member
by Alison Lomaka
Although the CComBSTR = operator is overloaded to make a copy of the string, this is not the case when assigning a CComVariant's bstrVal member to a CComBSTR.
Create Two-Dimensional Arrays in the Heap
by Arman Sahakyan
This code demonstrates how to create two-dimensional arrays in the heap.
The Added Benefit of Using New Instead of Malloc
by Pankaj Mishra
Not only does new allocate memory, it also calls the appropriate constructor.
Tracking Memory Leaks in Java
by Stephen Friend
Find out how you can track memory leaks in Java.
Protecting Freed Memory
by Sandesh Rane
Remember to be careful, when you're freeing memory, to set the memory contents to 0 so no other malicious program can read it after it's been freed.
Implementing the GetFreePhysicalMemory API in Linux
by Elsayed Elghadban
Because everything in Linux is composed of files, you can get any required information from the /proc/meminfo file.
Release Virtual Machine Resources
by Anitha Balakrishna
Failing to release virtual machine resources results in a 'memory leak.'
When to Pass Parameters by Value
by Wael Salman
The main reason to pass parameters by value is to improve performance, which is somewhat of a paradox, because this is also one of the main reasons to pass by reference.
When to Use Whole-object Member Variables
by Wael Salman
While it's usually best to use pointers for member variables rather than storing them by value, sometimes it's better to store the member as a whole object, that is, to store it by value.
A C++ Mutex Operation for Intel-compatible Processors
by Andrei Borac
Interprocess synchronization has always been classified as a "slow" operation, but that is largely only because the Windows implementation requires switching to kernel mode (an expensive operation) each time you attempt to acquire a mutex.
Use struct to Handle Heterogeneous Data Elements in C++
by Sayan Mukherjee
Read about the many benefits of using struct to handle heterogeneous data elements in C++.
Getting Around the Java Compiler's 64K Limitation
by Amit Jain
Find out how you can use inheritance to work around the Java compiler's 64K limitation.
Identifying Memory Leaks in Linux for C++ Programs
by Karthik Kumar Arun Kumar
The mtrace() function logs all memory leaks. Next, the memory allocations and deallocations are logged to a text file pointed to by the environment variable MALLOC_TRACE. Finally, a Perl utility called mtrace parses the text file logged by your program and identifies the memory leaks.
Debugging the Memory Leaks in MS VC++ 6.0
by Boris Eligulashvili
Fake Memory Leaks
by Danny Kalev
Some utilities and debugging tools mistakenly report that certain objects cause memory leaks.
Translate Your Program Easily
by Paul Marinescu
If you want your program to be easily translated into a different language, consider making every displayed text a resource in a dll. Every language will have its own .dll and the same text will ...
1-20 of 87     Previous     Next
Thanks for your registration, follow us on our social networks to keep up-to-date