heap-memory

How do you increase the maximum heap size for the javac process in Borland JBuilder 2005/2006

In most modern IDEs there is a parameter that you can set to ensure javac gets enough heap memory to do its compilation. For reasons that are not worth going into here, we are tied for the time being to JBuilder 2005/2006, and it appears the amount of source code has exceeded what can be handled by javac. Please keep the answer specifi...

How do I see memory allocation in a given .NET application?

I need to check how much memory is allocated in the heap. Is there a way to get this value programmatically with C#? I know about the System.Runtime.InteropServices.Marshal.SizeOf(...) but that only tells me the size of an object. ...

Understanding Objective-C's dynamic runtime

I'm getting my feet wet in Objective-C and Cocoa (I know, probably late, but hey I have to start somewhere) and I noticed that all objects are allocated out of the heap. Is there any reason why this is the standard in Objective-C? I tried looked everywhere (and yes, even on StackOverflow), but I couldn't find any explicit reason, except...

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 System.identityHashCode() never change during the object's lifetime? If it is a "one-shot" ...

HeapCreate vs GetProcessHeap

Hi I'm new to using Heap Allocation in C++. I'm tryin to understand the scenario that will force someone to create a private heap instead of using the Process Heap. Isn't Process Heap generally enough for most of the cases? Thanks --Ashish ...

How is heap and stack memories mananged, implemented, allocated?

In C/C++ we can store variables, functions, member functions, instances of a class either on a stack or a heap. How is each implemented? How is it managed (high level)? Does gcc preallocates a chunk of memory to be used for the stack and heap, and then doles out on request? Is original memory coming from RAM? Can a function be allo...

How is heap and stack memories mananged, implemented, allocated

Possible Duplicates: How is heap and stack memories mananged, implemented, allocated? Stack,Static and Heap in C++ In C/C++ we can store variables, functions, member functions, instances of a class either on a stack or a heap. How is each implemented? How is it managed (high level)? Does gcc preallocates a chunk of memory to...

HEAPSPACE ERROR: cannot figure out what is causing the error

Would anyone mind having a look at these bits of code and see if there is a memory leak in them, it isn't going to be overly large but my program keeps crashing after a while of running and I don't know how to use viualvm even though I have been reading up on it for several days now and haven't the slightest idea what I am looking for in...

How can I take a heap dump on Java 5 without garbage collecting first?

We have a long running server application running Java 5, and profiling it we can see the old generation growing slowly over time. It's correctly freed on a full GC, but I'd like to be able to look at the unreachable objects in Eclipse MAT using a heap dump. I've successfully obtained a heap dump using +XX:HeapDumpOnCtrlBreak, but the JV...

Can you declare a pointer on the heap?

This is the method for creating a variable on the heap in C++: T *ptr = new T; ptr refers to a pointer to the new T, obviously. My question is, can you do this: T *ptr = new T*; That seems like it could lead to some very, very dangerous code. Does anyone know if this is possible/how to use it properly? ...

Remaining heap size

I know this might be an oversimplification - but I need to know the amount of free memory I could allocate in my program. It's a windows mobile project (c++) and it seems like I might have a memory leak hiding somewhere. Calling a function which returns the remaining size (or remaining chunks) of heap storage I could access would be perf...

Increase heap size in java

Hello I am working on windows-2003 server(64-bit) with 8 GB ram. How can I increase the heap memory maximum. I am using -Xmx1500m command to increase the heap size with 1500mb. Can I increase the heap memory to 75% of physical memory(6GB Heap). Thanks ...

malloc code in C

I have a code block that seems to be the code behind malloc. But as I go through the code, I get the feeling that parts of the code are missing. Does anyone know if there is a part of the function that's missing? Does malloc always combine adjacent chunks together? int heap[10000]; void* malloc(int size) { int sz = (size + 3) / 4; int ...

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 correct, then why this error occurred after running fine for sometime as space for inst...

FileUtils.readFileToByteArray throwing java.lang.OutOfMemoryError: Java heap space error

I am using Apache Commons IO FileUtils utility to read a file into a byte array. The file is 1.13 gigabytes in size. Each time this method is called, I get an out of memory error. I have this running on a Windows Server 2008 64 bit server with 8GB of memory. The first time I got this error, I opened up the Tomcat 6 Configuration utility ...

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? ...

Java memory allocation limit

I have a loop that spawns a lot of threads. These threads contains, among other things, 2 (massive) StringBuilder objects. These threads then run and do their thing. However, I noticed that after a certain amount of threads, I get strange crashes. I know this is because of these StringBuilder, because when I reduce their initial capacit...

What is a good resource to read about stack/heap and symbol table concepts?

Please suggest some website or some book that deals with these topics in really good detail. I need to have a better understanding of these concepts (in reference to C++): stack and heaps symbol tables implementation of scope rules implementation of function calls ...

Heap error in C

I know this is really general, but I get "this" (see below) when I run my .c file in Visual C++ 2008 Express. It happens when I call malloc (). Take my work on this - I dynamically allocate memory properly. HEAP[Code.exe]: HEAP: Free Heap block 211a10 modified at 211af8 after it was freed Windows has triggered a breakpoint in Code...

Tomcat 6 Heap Size - Is this correct?

I am running multiple tomcats on a Red Hat box and I would like to configure separate heap size for each of them (some instances use more memory). Can I set the heap size min/max bt entering the following into the catalina.sh file: CATALINA_OPTS="-Xms64m -Xmx256m" Do I need add 'export'? i.e. export CATALINA_OPTS="-Xms64m -Xmx256m" ...