heap

Is it possible to compact the VC++ runtime heap?

Can I have the same effect as with HeapCompact() for the Visual C++ runtime heap? How can I achieve that? ...

Windows assembly heap and stack?

OS: Windows 7 32bit So in like c++ one has a heap and a stack. But i've been starting on some assembly learning lately and haven't seen anything of the sort, only a stack but it just looks like pure memory. So is heap and stack implementation specific for c++ and other languages? Or do you still get allocated a heap and stack in assemb...

How to analyze Heap Dumps

Hi Guys, I am successful in generating Heap Dumps of my application machine but I do not know how to analyze it. Can someone tell me how to? Thanks and Regards, Deepti ...

Java Heap Indirect Access

Currently I use a HashMap<Class, Set<Entry>>, which may contain several millions of short-lived and long-lived objects. (Entry is a wrapper class around an Object and an integer, which is a duplicate count). I figured: these Objects are all stored in the JVM's Heap. Then my question popped in my mind; instead of allocating huge amounts ...

java cannot reserver heap size error on windows server

HI, I have the following configuration: Server : windows 2003 server (32 bit) java version: 1.5_0_22 I get the following error when executing from command line ( my code is based off eclipse wihch gives the same error) java -XX:MaxPermSize=256m -Xmx512m Error occurred during initialization of VM Could not reserve enough space for o...

Java Heap Overflow, Forcing Garbage Collection

I've create a trie tree with an array of children. When deleting a word, I set the children null, which I would assume deletes the node(delete is a relative term). I know that null doesn't delete the child, just sets it to null, which when using a large amount of words it causes to overflow the heap. Running a top on linux, I can see m...

java outOfMemoryError with stringbuilder

I'm getting a java outOfMemoryError when I call this method - i'm using it in a loop to parse many large files in sequence. my guess is that result.toString() is not getting garbage collected properly during the loop. if so, how should i fix it? private String matchHelper(String buffer, String regex, String method){ Pattern abbrev_p...

Basic Java Multi-Threading Question

When an object is instantiated in Java, is it bound to the thread that instantiated in? Because when I anonymously implement an interface in one thread, and pass it to another thread to be run, all of its methods are run in the original thread. If they are bound to their creation thread, is there anyway to create an object that will run ...

Does operator new allocate on THREAD heap?

My problem seems to be this: heap data allocated by one thread (that later dies) seems to die as well. As so: Thread X: starts Thread Y: starts Thread X: ptr = new some bytes Thread X: dies Thread Y: tries to use ptr - and crashes! So far, I've only seen this problem on Darwin (Mac OS 10.5 and 10.6), but haven't tried more other plat...

Generating heap dump from Java code

Hi, I'm trying to programm a self destruction logic. I've already created a global ExceptionHandler which will be processed in some cases. I want to collect some system information before the destruction. One information should be the current heap dump. I found The following page http://blogs.sun.com/sundararajan/entry/programmatically_...

Threading heap and stack

How memory is allocated in case of spawning a new thread, i.e how memory heap, memory stack, and threads are related? I know this is fundamental (.net framework concept) but somehow I am not much aware of this concept. ...

Understanding max JVM heap size - 32bit vs 64bit

I've read the max heap size on 32bit Windows is ~1.5GB which is due to the fact that the JVM requires contiguous memory. Can someone explain the concept of "contiguous memory" and why you only have max 1.5GB on Windows? Secondly, what then is the max heap size on 64 bit Windows and why is this different than what's available on 32 bit?...

Hibernate - on the stack or on the heap?

As a Java programmer, you usually keep two truths in your pocket: Instance variables and Objects lie on Heap. Local variables and methods lie on the Stack. Now that I use Hibernate in just about everything, I realize I'm not as sure of myself. Are there some good rules of thumb for using hibernate and knowing where your memory liv...

Java Citrix Memory problem

Here is a puzzle that has got me baffled. We are running a Citrix server that provides access to two other servers, let's call them Application Server E and Application Server C. Each Application server is running the identical Tomcat environment. Users access through a web browser, a java based application (an applet). In one me...

heap sort function explanation needed

Hello, Can someone clearly explain me how these functions of heap sort are working?? void heapSort(int numbers[], int array_size) { int i, temp; for (i = (array_size / 2)-1; i >= 0; i--) siftDown(numbers, i, array_size); for (i = array_size-1; i >= 1; i--) { temp = numbers[0]; numbers[0] = numbers[i]; numbers[...

What do I use for a max-heap implementation in Python?

Python includes the heapq module for min-heaps, but I need a max heap. What should I use for a max-heap implementation in Python? ...

Applet A* pathfinding using large byte[] arrays - heap space error

I've written a basic Java applet which works as a map viewer (like Google Maps) for a game fansite. In it, I've implemented an A* pathfinding algorithm on a 2D map with 16 different floors, "connected" on certain points. The floors are stored in PNG images which are downloaded when needed and converted to byte arrays. The node cost is ...

Where the Static variable stores ( Data segment or Heap or BSS) ?

Some people are saying " static variable store its value in HEAP ", and others saying " static variable store store its value in DATA segment". I am totally confused with these conflict answers. Where exactly static variable stores?. I am expecting an answer with standard reference ( text books, or good author tutorial). Static variabl...

Does a garbage collector collect stack memory, heap memory, or both?

I read lot of articles about garbage collection and almost all article tells about heap memory. so my question is "garbage collection collects stack memory or heap memory or both". thanks Kalpesh ...

Java -Xms initial size effects

Hi. What is the benefit of setting the -Xms parameter, and having the initial memory larger for example, then the default calculated one (64 MB in my case, according to Java GC tunning: http://java.sun.com/javase/technologies/hotspot/gc/gc_tuning_6.html#par_gc.ergonomics.default_size)? Also, is there any good to setting both the initia...