heap-memory

How to find memory leaks in my Java application

江枫思渺然 提交于 2019-12-22 10:27:43
问题 This is a follow-up question from my previous question HERE. I was witnessing memory leaks in my Java application. Initially, I was thinking that the leak is coming from the Server component of my application. But as per other's suggestion, it wasn't. I used a tool to dump the heap memory and visualize it with JProfiler . Apparently it is due to my suspected HashMaps . But I'm not sure as I'm not familiar how to interpret the dump. Here is a brief snippet of my application's structure (it is

get the max heap size of a node.js application

筅森魡賤 提交于 2019-12-22 08:46:29
问题 Now I am using node.js in paas platform. And the container has memory limit. Now I want to get the maximum of the heap size of node.js application. I know that use the parameter "--max-old-space-size", I can set the max heap size, but I want to know how to get the default value of "--max-old-space-size". For example, if the container's memory is 512m , so the maximum of node.js heap size can not be greater than it. How can I get the value? 回答1: You can try the v8 module, it is documented here

Unable to execute dex because of java heap space in eclipse with a tiny android application

天涯浪子 提交于 2019-12-22 06:46:15
问题 I have an android application that only has one jar import which is 4 mb in size (Symja https://code.google.com/p/symja/) Literally the only code in the project is creating a new textview and setting it as the content view. But I am getting the error(s): Conversion to Dalvik format failed: Unable to execute dex: Java heap space Unable to execute dex: Java heap space I have another android project which is alot bigger, almost 20,000 lines of code and it runs in seconds. My eclipse.ini has the

Why does allocated size of permanent generation increase after executing perform GC?

不想你离开。 提交于 2019-12-22 04:51:04
问题 Following are the snapshots I took after executing perform GC from jvisualvm. and First image is Heap stats and 2nd one is perm gen stats. I am not able to understand when I did GC utilized heap size decreased(as expected) but the allocated size of permanent generation increased (though the utilized permgen size remained the same). What could be the possible explanation of such behavior? JVM arguments used -Xbootclasspath/p:../xyz.jar -Xbootclasspath/a:../abc.jar -Djava.endorsed.dirs=..

How many cpu cycles an object creation takes in java?

做~自己de王妃 提交于 2019-12-22 00:30:03
问题 I am curious how many cpu cycle or time does it takes to create an object of class that has no field in java? I was disscussing it with colleague whether it would be good idea to create new object for unique way to reffer something or create uuid, in his defence he said that creating object is very light weight in java these days, which I also agree. But question is how can it compare to something completely different like uuid generation? Hence, the doubt how much cpu cycles does it takes to

Java: Method hooking & Finding object instances

邮差的信 提交于 2019-12-22 00:29:25
问题 Situation Hi, I have 2 problems. The situation is that I'm writing a Java API for Windows that also provides tools for injecting code into a process and then manipulate the target. I have already implemented the injection-part , for example injecting a jar into another jar. At this point my jar gets called (while the target already is at runtime) and starts in a complete static context . Goals & problems From here I have two goals: I'd like to interact with the targets objects , thus I need

How to increase heap size on Android 2.3 (Gingerbread)?

北城余情 提交于 2019-12-21 23:01:04
问题 I am getting an OutOfMemoryError when I try to create a String larger than 4MB using StringBuilder.append() . As far as I know, StringBuilder doesn't have any limitations regarding size and so doesn't String . So I searched for "how to increase Android heap size" and as far as I could conclude from this answer and this answer, Gingerbread is the only version in which you have no way of dealing with the heap size, since for earlier versions you use the VMRuntime class and for newer versions

Rules for String a == String b [duplicate]

梦想与她 提交于 2019-12-21 14:50:14
问题 This question already has answers here : How do I compare strings in Java? (23 answers) Closed 3 years ago . I'm trying to understand how the String pool works and what are the rules for a string to be equal to another String. For example this snippet : public static void main(String[] hi){ String s1 = "lol"; String s2 = "lol"; String s3 = new String("lol"); System.out.println( s1 == s2 );// true System.out.println( s2 == s3); // false s3.intern(); //line 1 System.out.println( s1 == s3); //

System.gc() vs GC button in JVisualVM/JConsole

試著忘記壹切 提交于 2019-12-21 02:44:38
问题 I'm currently testing my proof of concept prototype dealing with XML schema, and built around a very memory consuming external library for tree automata (for which I've got the sources), I'd like to plot "real peak" (heap) memory consumption of the different runs with increasing schema sizes (the metric used fits my purpouse and do no affect the question), or at least a reasonable approximation of it. To give an order of magnitude, for a run with a real peak of 100MB (I tested it running

Use of struct initialization syntax for on-heap struct

大城市里の小女人 提交于 2019-12-20 03:30:23
问题 I have this simple structure I want to initialize on the heap and return as a pointer in a function. struct entry { const char* const key; // We don't want the key modified in any way const void* data; // But the pointer to data can change struct entry* next; }; There is one problem, I cannot calloc it and initialize members one by one because key is a const pointer. I found somewhere this syntax that works: struct entry* entry = calloc(1, sizeof(struct entry)); *entry = (struct entry) { .key