heap

Can you tune C runtime heap segment reservation size on XP?

When the VC6 C runtime on XP can't serve an allocation request within an existing heap segment, it reserves a new segment. The size of these new segments increase by factors of 2 (until there are not large enough free areas to do that, at which point it falls down to smaller segments.) In any case, is there any way to control this behav...

ConcurrentLinkedQueue$Node remains in heap after remove()

I have a multithreaded app writing and reading a ConcurrentLinkedQueue, which is conceptually used to back entries in a list/table. I originally used a ConcurrentHashMap for this, which worked well. A new requirement required tracking the order entries came in, so they could be removed in oldest first order, depending on some condition...

how to disable creating java heap dump after VM crashes?

JVM runs on FreeBSD with 18Gb memory. creating core file takes about hour, which is very slow, so i need some way to disable it. ...

Examining C/C++ Heap memory statistics in gdb

I'm trying to investigate the state of the C/C++ heap from within gdb on Linux amd64, is there a nice way to do this? One approach I've tried is to "call mallinfo()" but unfortunately I can't then extract the values I want since gdb doesn't deal with the return value properly. I'm not easily able to write a function to be compiled into...

Fields of class, are they stored in the stack or heap?

I saw a question yesterday which raised (for me) another question. Please look at the following code: public class Class1 { int A; //as I uderstand, int is value type and therefore lives in the stack } class Class2 { Run() { Class1 instance1 = new Class1(); instance1.A = 10; //it points to value type, but isnt ...

Memory in Eclipse

I'm getting the java.lang.OutOfMemoryError exception in Eclipse. I know that Eclipse by default uses heap size of 256M. I'm trying to increase it but nothing happens. For example: eclipse -vmargs -Xmx16g -XX:PermSize=2g -XX:MaxPermSize=2g I also tried different settings, using only the -Xmx option, using different cases of g, G, m, M,...

Putting a C++ Vector as a Member in a Class that Uses a Memory Pool

Hey, I've been writing a multi-threaded DLL for database access using ADO/ODBC for use with a legacy application. I need to keep multiple database connections for each thread, so I've put the ADO objects for each connection in an object and thinking of keeping an array of them inside a custom threadInfo object. Obviously a vector would ...

Java heap size - will this work?

Hi, I try this with NetBeans desktop application template - increasing heapsize (to 512 MiB) of executed .jar file. (I believe that NetBeans uses Singleton app by default - SingleFrameView) Will it work? public static void main(String[] args) { if (args == null) { args = new String[1]; args[0] = "Xmx5...

How do I find the median of numbers in linear time using heaps?

Wikipedia says: Selection algorithms: Finding the min, max, both the min and max, median, or even the k-th largest element can be done in linear time using heaps. All it says is that it can be done, and not how. Can you give me some start on how this can be done using heaps? ...

C String literals: Where do they go?

I have read a lot of posts about "string literals" on SO, most of which have been about best-practices, or where the literal is NOT located in memory. I am interested in where the string DOES get allocated/stored, etc. I did find one intriguing answer here, saying: Defining a string inline actually embeds the data in the program it...

Using StringBuilder to process csv files to save heap space

I am reading a csv file that has about 50,000 lines and 1.1MiB in size (and can grow larger). In Code1, I use String to process the csv, while in Code2 I use StringBuilder (only one thread executes the code, so no concurrency issues) Using StringBuilder makes the code a little bit harder to read that using normal String class. Am I p...

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

adjacency list creation , out of Memory error

Hello , I am trying to create an adjacency list to store a graph.The implementation works fine while storing 100,000 records. However,when I tried to store around 1million records I ran into OutofMemory Error : Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOfRange(Arrays.java:...

netbeans ide python: how to increase VM heap size

Hello, Can I ask how I can increase the heap memory in NetBeans IDE 6.7 for Python? I am getting "java.lang.OutOfMemoryError". I have tried to find a VM option, but I could not find it in "Project Options" (it does not resemble to NetBeans IDE 6.7.1 for Java). I have tried to change default_netbeans option in file netbeans.conf (there i...

OQL query to find all instances and sub-instances of a given class refered to from a session

Hi All, I'm trying to use jhat/OQL to trace a memory leak in our Tomcat container. The question I want to ask is: "Show me all the instances (and sub-instances) of foo.bar.Cacheable class that are reachable from javax.servlet.http.HttpSession" I managed to come up with the following, but this doesn't show subclasses of foo.bar.Cacheab...

What do the 'size' numbers mean in the windbg !heap output?

I see output like this in my DMP file: Heap entries for Segment00 in Heap 00150000 00150640: 00640 . 00040 [01] - busy (40) 00150680: 00040 . 01808 [01] - busy (1800) 00151e88: 01808 . 00210 [01] - busy (208) 00152098: 00210 . 00228 [00] 001522c0: 00228 . 00030 [01] - busy (22) 001522f0: 00030 . 00018 [01] - busy...

Getting the start address of the current process's heap?

I am exploring the lower level workings of the system, and was wondering how malloc determines the start address of the heap. Is the heap at a constant offset or is there a call of some sort to get the start address? Does the stack affect the start address of the heap? ...

to understand the code- how the heap is written in process migration in solaris

hi guys i need help understanding what this piece of code actually does as it is a part of my project i am stuck here. the code is from libckpt on solaris. /************************************************************** * function: write_heap * args: map_fd -- file descriptor for map file * data_fd -- file descriptor for data ...

Is it possible to run Weblogic with 8gb heap size in a 64bit java/linux environment

Setup: 64bit Linux 64bit SUN Jvm 1.6.0_20 Weblogic 10.3 Is it possible to run Weblogic 10.3 in this setup with a maximum heap size of 8gb? We have recived answers from oracle support that states that it might not be possible to address more than 4gb with this setup. Please submit any official links that support any statements that i...

OQL - Find certain (sub)-members of a given object

I'm analyzing heap dumps in a Portal App. With the help of OQL I found the MemorySessionData Object with its address. Now I want to find all SerializableViewState Objects, that are hold by Objects hold by this MemorySessionData object. In other words: My MemorySessionData Object holds several objects, these hold objects again and so on....