heap-memory

Java: Method hooking & Finding object instances

家住魔仙堡 提交于 2019-12-04 19:20:23
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 references . For many objects this is already possible because they provide static access to their

Heap error in C

*爱你&永不变心* 提交于 2019-12-04 17:14:11
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.exe. This may be due to a corruption of the heap, which indicates a bug in Code.exe or any of the DLLs it has loaded. This may also be due to the user pressing F12 while Code.exe has focus. The output window may have more diagnostic information. Why do I get this

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

那年仲夏 提交于 2019-12-04 16:13:54
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 android:largeHeap="true" on the Manifest. Is that assumption correct? What do you do when you're in

java.lang.OutOfMemoryError: Java heap space when stitching 13k .png images together

谁说我不能喝 提交于 2019-12-04 14:28:19
I have 13255 images, each 240 x 240 pixels wide, the biggest 15,412 bytes in size and the smallest 839 bytes. I am trying to loop through the folder adding each of them to a File[]. Once I have an array of each image I am then placing them inside a BufferedImage[] ready to be looped through and drawn onto a larger single image made up of each individual one. Each image is named in the form of Image x-y.png However, I keep ending up with a java.lang.OutOfMemoryError: Java heap space error. I have no idea why. I have tried altering the size of the memory available to the JVM by adding parameters

Why does JVM heap keep growing?

爱⌒轻易说出口 提交于 2019-12-04 10:39:35
问题 I write a simple program and use jconsole.exe to monitor its heap size. public class HeapTest { public static void main(String[] args) { while(true) { } } } Here is the result I don't understand why the heap size keeps growing. I don't new() any Object in my program. What is the heap used for in my program? I don't add any additional arguments to jconsole.exe; just double click on it, then load the java process according to PID. Environment: Java 1.8.0_25 under windows 7 回答1: There is no

Long incidental Young garbage collection pauses

大城市里の小女人 提交于 2019-12-04 08:34:26
We tune our GC for minimum "stop-the-world" pauses. Perm and Tenured generations behave well. Young works fine most of the time, and the pauses usually don't exceed 500ms (note [Times: user=0.35 sys=0.02, real=0.06 secs]): {Heap before GC invocations=11603 (full 60): par new generation total 3640320K, used 3325226K [0x0000000600000000, 0x00000006f6e00000, 0x00000006f6e00000) eden space 3235840K, 100% used [0x0000000600000000, 0x00000006c5800000, 0x00000006c5800000) from space 404480K, 22% used [0x00000006de300000, 0x00000006e3a4a898, 0x00000006f6e00000) to space 404480K, 0% used

Rules for String a == String b [duplicate]

谁都会走 提交于 2019-12-04 07:56:00
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); // false testString(s1); } private static void testString(String s1){ String s4 = "lol"; System.out.println

What's the difference between delete-ing a pointer and setting it to nullptr? [duplicate]

孤街醉人 提交于 2019-12-04 03:34:12
问题 This question already has answers here : delete vs NULL vs free in c++ (6 answers) Closed 4 years ago . Is saying delete pointer and pointer = nullptr the same? Probably not, but does the latter free up memory? What about delete pointer; pointer = nullptr / pointer = nullptr; delete pointer ? Why not use that to make a safe way to delete pointers prematurely if required, where they would normally be deleted some other time and cause an error with a normal delete? 回答1: It is not the same,

Why does G1GC shrink the young generation before starting mixed collections?

萝らか妹 提交于 2019-12-04 01:24:59
When G1 decides it needs to start doing mixed collections, it aggressively shrinks our Eden space from 10g to about 1g. {Heap before GC invocations=294 (full 0): garbage-first heap total 20480000K, used 18304860K [0x00000002de000000, 0x00000002de804e20, 0x00000007c0000000) region size 8192K, 1363 young (11165696K), 11 survivors (90112K) Metaspace used 37327K, capacity 37826K, committed 38096K, reserved 1083392K class space used 3935K, capacity 4081K, committed 4096K, reserved 1048576K 2016-03-31T20:57:31.002+0000: 7196.427: [GC pause (G1 Evacuation Pause) (young) Desired survivor size

Play Framework - can not reserve enough space for object heap

我是研究僧i 提交于 2019-12-03 16:50:20
问题 I made some modifications to my play project and when I try and run it I get errors. >play run Error occurred during initialization of VM Could not reserve enough space for object heap Error: Could not create the Java Virtual Machine. Error: A fatal exception has occured. Program will exit. Is this a common problem? I am fairly inexperienced with the play framework but I have ran my project several times before without encountering this error. Edit: Information regarding java version. >java