Top "Memory" questions

Use this tag for memory management or issues in programming.

Java get available memory

Is there any good way to get the remaining memory available to the JVM at run time? The use case …

java performance web-services memory operating-system
What is memory fragmentation?

I've heard the term "memory fragmentation" used a few times in the context of C++ dynamic memory allocation. I've found …

c++ memory heap fragmentation
What's the difference between assignment operator and copy constructor?

I don't understand the difference between assignment constructor and copy constructor in C++. It is like this: class A { public: …

c++ memory
scala vs java, performance and memory?

I am keen to look into Scala, and have one basic question I cant seem to find an answer to: …

java performance scala memory
Purpose of memory alignment

Admittedly I don't get it. Say you have a memory with a memory word of length of 1 byte. Why can't …

memory alignment memory-alignment
How can I get the memory that my Java program uses via Java's Runtime api?

There are similar questions out there, but they seem to avoid answering this specific question. How can I get the …

java api memory runtime
Determine size of dynamically allocated memory in C

Is there a way in C to find out the size of dynamically allocated memory? For example, after char* p = …

c memory dynamic size allocation
String literals: Where do they go?

I am interested in where string literals get allocated/stored. I did find one intriguing answer here, saying: Defining a …

c memory string-literals
malloc(sizeof(int)) vs malloc(sizeof(int *)) vs (int *)malloc(sizeof(int))

I acknowledge that all three of these have a different meaning. But, I don't understand on what particular instances would …

c memory allocation malloc
How to dismiss AlertDialog.Builder?

In the following code below, how do I dismiss the alert box? I don't want to cause a memory leak. …

android memory dialog alert dismiss