heap-memory

Java heap space out of memory

做~自己de王妃 提交于 2019-12-17 05:00:57
问题 My application currently consumes quite a lot of memory because it is running physics simulations. The issue is that consistently, at the 51st simulation, java will throw an error usually because of a heap space out of memory (my program eventually runs thousands of simulations). Is there anyway I can not just increase the heap space but modify my program so that the heap space is cleared after every run so that I can run an arbitrary number of simulations? Thanks -edit- Thanks guys. Turns

Why are two different concepts both called “heap”?

无人久伴 提交于 2019-12-17 02:30:11
问题 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? 回答1: Donald Knuth says (The Art of Computer Programming, Third Ed., Vol. 1, p. 435): Several authors began about 1975 to call the pool of available memory a "heap." He doesn't say which authors and doesn't give references to any specific papers, but does say that the use of the term "heap" in relation to priority queues is the traditional

Java 7 (JDK 7) garbage collection and documentation on G1

落花浮王杯 提交于 2019-12-16 22:22:30
问题 Java 7 has been out for a while now, but I cannot find any good resources on the configuration of the garbage collectors , specifically the new G1 collector . My questions: Is G1 the default collector in Java 7 and if not how do I activate G1? What optional settings does g1 have in Java7? Were there any changes made to other collectors like cms or the parallel collector in Java 7? Where can I find good documentation on garbage collection in Java 7? 回答1: The G1 garbage collector is not the

How does string works in c#? [closed]

笑着哭i 提交于 2019-12-14 03:38:27
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago . I know strings are inmutable, once created we cannot change it, I've read that if we create a new string object and we assign a value to it and then we assign another value to the same string object internally there is actually another object created and assigned with the new

Outof memory error while working on large dataset

烈酒焚心 提交于 2019-12-14 03:31:11
问题 I am running a code on LSI, which requires first fetching a lot of data from database. It is working fine for small data-set. As, i increase the data-set, it gives me the following error. Exception in thread "main" java.lang.OutOfMemoryError: Java heap space I am currently running the code on system having 2 GB of RAM. Is the error related to RAM capacity or due to something else. Thanks! 回答1: When you run Java you'll have to pass VM parameters for your specific concerns. You need to increase

Why the heap is changing in java

不想你离开。 提交于 2019-12-14 03:28:12
问题 we are starting the java process with -Xms equals to -Xmx valuem for example: -Xms1500m -Xmx1500m -Dos.heap.max=1500m -verbose:gc -XX:MaxPermSize=256m and for some reason the heap is changing during runtime...: [GC 624542K->464935K(1472000K), 0.0647450 secs] Wed Jul 3 15:58:23 2013 [GC 808811K->813332K(1472000K), 0.1407890 secs] Wed Jul 3 15:58:23 2013 [Full GC 813332K->636599K(1472000K), 0.7913590 secs] Wed Jul 3 15:58:24 2013 [GC 1016090K->956043K(1258752K), 0.1209670 secs] Wed Jul 3 15:58

Read big text file to HashMap - heap overflow

半城伤御伤魂 提交于 2019-12-13 19:00:26
问题 I'm trying to get the data from a text file into a HashMap. The text-file has the following format: it has something like 7 million lines... (size: 700MB) So what I do is: I read each line, then I take the fields in green and concatenate them into a string which will the HashMap key. The Value will be the fild in red. everytime I read a line I have to check in the HashMap if there is already an entry with such key, if so, I just update the value summing the value with the red; If not, a new

HeapCreate and HeapAlloc Confuse

戏子无情 提交于 2019-12-13 18:25:31
问题 I am doing a project on dynamic memory management. I run into a confuse about the HeapCreate and HeapAlloc functions. For the HeapCreate() function, we can create a heap and the function will return a HANDLE. We can initialize the size of heap. Let's say winHandle = HeapCreate( 0, 2 * 1024, 0); Then, I can the HeapAlloc function to allocate on this heap. But I am confuse about the size of the heap. I try an example, I call the HeapAlloc( winHandle, 0, 1024) twice on this heap, so the total

Auto restart jar on OutOfMemoryError Linux

和自甴很熟 提交于 2019-12-13 17:13:48
问题 How can i auto-restart the runnable jar file in Linux. I am running jar in linux VPS in a separate screen but it stops after some time due to OUTOFMEMORYERROR Java heap space. 回答1: Write a simple launcher which will restart the application once it came down. Something like this: #!/bin/sh TEMPFILE=`mktemp` while true ; do echo "`date` Starting application" >> $TEMPFILE java -XX:OnOutOfMemoryError="kill -9 %p" -jar application.jar sleep 5 done Just to be sure that the VM comes done correcly,

java.lang.OutOfMemoryError: Java heap space [duplicate]

落花浮王杯 提交于 2019-12-13 09:48:05
问题 This question already has answers here : How to memory profile in Java? (5 answers) Closed 5 years ago . java.lang.OutOfMemoryError: Java heap space at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.<init>(UTF8Reader.java:122) at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.createReader(XMLEntityManager.java:2344) at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:684) at com.sun.org.apache.xerces.internal.impl