Questions tagged [heap-memory]

The heap is process memory set aside for dynamic allocation.

A heap memory pool is an internal memory pool created at start-up that tasks use to dynamically allocate memory as needed. This memory pool is used by tasks that requires a lot of memory from the stack, such as tasks that use wide columns.

For example, in Sybase's Adaptive Server Enterprise, if you make a wide column or row change, the temporary buffer this task uses can be as large as 16K, which is too big to allocate from the stack. Adaptive Server dynamically allocates and frees memory during the task’s runtime.

The heap memory pool dramatically reduces the predeclared stack size for each task, while also improving the efficiency of memory usage in the server. The heap memory the task uses is returned to the heap memory pool when the task is finished.

Microsoft describes a heap for their SQL Server 2008 R2 as a table without a clustered index. Heaps have one row in sys.partitions, with index_id = 0 for each partition used by the heap. By default, a heap has a single partition. When a heap has multiple partitions, each partition has a heap structure that contains the data for that specific partition. For example, if a heap has four partitions, there are four heap structures; one in each partition.

2513 questions
871
votes
20 answers

Error java.lang.OutOfMemoryError: GC overhead limit exceeded

I get this error message as I execute my JUnit tests: java.lang.OutOfMemoryError: GC overhead limit exceeded I know what an OutOfMemoryError is, but what does GC overhead limit mean? How can I solve this?
Mnementh
  • 47,129
  • 42
  • 140
  • 198
464
votes
10 answers

How is the default max Java heap size determined?

If I omit the -Xmxn option from the Java command line then a default value will be used. According to Java documentation "the default value is chosen at runtime based on system configuration" What system configuration settings influence the…
Richard Dorman
  • 21,020
  • 12
  • 42
  • 48
460
votes
24 answers

How to deal with "java.lang.OutOfMemoryError: Java heap space" error?

I am writing a client-side Swing application (graphical font designer) on Java 5. Recently, I am running into java.lang.OutOfMemoryError: Java heap space error because I am not being conservative on memory usage. The user can open unlimited number…
Eugene Yokota
  • 90,473
  • 43
  • 204
  • 301
346
votes
28 answers

Node.js heap out of memory

Today I ran my script for filesystem indexing to refresh RAID files index and after 4h it crashed with following error: [md5:] 241613/241627 97.5% [md5:] 241614/241627 97.5% [md5:] 241625/241627 98.1% Creating missing list... (79570 files…
Lapsio
  • 4,374
  • 2
  • 16
  • 22
331
votes
5 answers

Java heap terminology: young, old and permanent generations?

I'm trying to understand What the concepts of young, old and permanent generations are in the Java heap terminology, and more specifically the interactions between the three generations. My questions are: What is the young generation? What is the…
knorv
  • 45,461
  • 71
  • 205
  • 289
319
votes
16 answers

java.lang.OutOfMemoryError: GC overhead limit exceeded

I am getting this error in a program that creates several (hundreds of thousands) HashMap objects with a few (15-20) text entries each. These Strings have all to be collected (without breaking up into smaller amounts) before being submitted to a…
PNS
  • 17,431
  • 26
  • 86
  • 131
293
votes
12 answers

Increase heap size in Java

I am working on a Windows 2003 server (64-bit) with 8 GB RAM. How can I increase the heap memory maximum? I am using the -Xmx1500m flag to increase the heap size to 1500 Mb. Can I increase the heap memory to 75% of physical memory (6 GB Heap)?
Sunil
  • 3,693
  • 6
  • 20
  • 21
190
votes
9 answers

Why are two different concepts both called "heap"?

Why are the runtime heap used for dynamic memory allocation in C-style languages and the data structure both called "the heap"? Is there some relation?
Andrey Fedorov
  • 7,836
  • 20
  • 63
  • 95
190
votes
5 answers

Stack vs heap allocation of structs in Go, and how they relate to garbage collection

I'm new to Go and I'm experiencing a bit of cognitive dissonance between C-style stack-based programming where automatic variables live on the stack and allocated memory lives on the heap and Python-style stack-based-programming where the only thing…
Joe
  • 42,600
  • 24
  • 134
  • 225
168
votes
23 answers

Setting variable to NULL after free

In my company there is a coding rule that says, after freeing any memory, reset the variable to NULL. For example ... void some_func () { int *nPtr; nPtr = malloc (100); free (nPtr); nPtr = NULL; return; } I feel that, in…
Alphaneo
  • 10,931
  • 20
  • 65
  • 87
148
votes
9 answers

Detect application heap size in Android

How do you programmatically detect the application heap size available to an Android app? I heard there's a function that does this in later versions of the SDK. In any case, I'm looking for solution that works for 1.5 and upwards.
hpique
  • 112,774
  • 126
  • 328
  • 461
101
votes
12 answers

java.lang.OutOfMemoryError: Java heap space

I am getting the following error on execution of a multi-threading program java.lang.OutOfMemoryError: Java heap space The above error occured in one of the threads. Upto my knowledge, Heap space is occupied by instance variables only. If this is…
Yatendra
  • 31,339
  • 88
  • 211
  • 291
82
votes
8 answers

Java 7 (JDK 7) garbage collection and documentation on G1

Java 7 has been out for a while now, but I cannot find any good resources on the configuration of the garbage collectors, specifically the new G1 collector. My questions: Is G1 the default collector in Java 7 and if not how do I activate G1? What…
Florakel
  • 1,131
  • 1
  • 10
  • 8
74
votes
10 answers

How to analyze memory using android studio

Recently switch to android studio from eclipse. How to check app heap and memory allocation in android studio? In Eclipse we have MAT is there anything in the studio to check heap dump, hprof file?
Prachi
  • 2,549
  • 4
  • 23
  • 37
72
votes
5 answers

How does the JVM ensure that System.identityHashCode() will never change?

Typically the default implementation of Object.hashCode() is some function of the allocated address of the object in memory (though this is not mandated by the JLS). Given that the VM shunts objects about in memory, why does the value returned by…
butterchicken
  • 12,625
  • 2
  • 30
  • 42
1
2 3
99 100