heap-memory

Agressive garbage collector strategy

冷暖自知 提交于 2019-11-28 17:01:43
I am running an application that creates and forgets large amounts of objects, the amount of long existing objects does grow slowly, but this is very little compared to short lived objects. This is a desktop application with high availability requirements, it needs to be turned on 24 hours per day. Most of the work is done on a single thread, this thread will just use all CPU it can get it's hands. In the past we have seen the following under heavy load: The used heap space slowly goes up as the garbage collector collects less than the amount of memory newly allocated, the used heap size

Will OpenJDK JVM ever give heap memory back to Linux?

主宰稳场 提交于 2019-11-28 16:48:48
We have a long-lived server process, that infrequently needs a lot of RAM for a short while. We see that once the JVM has gotten the memory from the OS, it never returns it back to the OS. How do we ask the JVM to return heap memory back to the OS? Typically, the accepted answer to such questions is to use -XX:MaxHeapFreeRatio and -XX:MinHeapFreeRatio . (See e.g. 1 , 2 , 3 , 4 ). But we're running java like this: java -Xmx4G -XX:MaxHeapFreeRatio=50 -XX:MinHeapFreeRatio=30 MemoryUsage and still see this in VisualVM: Clearly, the JVM is not honoring -XX:MaxHeapFreeRatio=50 as the heapFreeRatio

Good introductory text about GHC implementation?

允我心安 提交于 2019-11-28 15:03:50
When programming in Haskell (and especially when solving Project Euler problems, where suboptimal solutions tend to stress the CPU or memory needs) I'm often puzzled why the program behaves the way it is. I look at profiles, try to introduce some strictness, chose another data structure, ... but mostly it's groping in the dark, because I lack a good intuition. Also, while I know how Lisp, Prolog and imperative languages are typically implemented, I have no idea about implementing a lazy language. I'm a bit curious too. Hence I would like to know more about the whole chain from program source

Stack vs heap allocation of structs in Go, and how they relate to garbage collection

a 夏天 提交于 2019-11-28 14:57:26
I'm new to Go and I'm experiencing a bit of congitive dissonance between C-style stack-based programming where automatic variables live on the stack and allocated memory lives on the heap and and Python-style stack-based-programming where the only thing that lives on the stack are references/pointers to objects on the heap. As far as I can tell, the two following functions give the same output: func myFunction() (*MyStructType, error) { var chunk *MyStructType = new(HeaderChunk) ... return chunk, nil } func myFunction() (*MyStructType, error) { var chunk MyStructType ... return &chunk, nil } i

Why does my Java process consumes twice memory inside a docker container vs host

我们两清 提交于 2019-11-28 12:35:48
I faced an interesting problem trying to analyze a memory consumption in my Java application running on docker container vs host machine. The Java app is web app on the Jetty server 9.4.9 Java version : 1.8 Host : MAC Docker images: jetty:9.4-jre8 The docker daemon is 18.03.1-ce version. On the host I'm using Yourkit tool to analyze a memory consumption. For docker container docker stats <docker id/name> What I'm getting is that on MAC yourkit shows me 50M Non-heap size + ~40M heap size, in total ~ 100M Whereas, when I deploy and run the same war on a container, the stats shows me 200M

Out of memory cache error when accessing inside the app

半世苍凉 提交于 2019-11-28 12:12:03
问题 I've searched a lot but I did not understand where to is my error. First in my app I am getting images from the web if there is no net I am getting them from created database. I am going to post my ImageLoader class then the memory class then the utils class if there is something wrong please I need some help Thanks in advance. public class ClassImageLoader { ClassMemoryCache memoryCache=new ClassMemoryCache(); ClassFileCache fileCache; private Map<ImageView, String> imageViews=Collections

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

怎甘沉沦 提交于 2019-11-28 11:15:34
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 JVM always does a GC before dumping the heap. Apparently this doesn't happen on Java 6 but we're stuck on 5 for now. Is there any way to prevent this? I suggest a 3rd-party profiler such as YourKit , which may allow you to take snapshots without kicking off the

How do I increase Groovy's JVM Heap Size?

ぐ巨炮叔叔 提交于 2019-11-28 11:06:51
Some sources on the web claims that I should be able to give the -Xmx param to groovy but that just gives me java.io.FileNotFoundException when it can't find the -Xmx file. Other sources tell me to set some variable named JAVA_OPTS but how do I do that? And how do I know if it worked? $ export JAVA_OPTS="$JAVA_OPTS -Xmx64M" $ groovy UPDATED: Go to your Groovy home folder and go into the bin directory. In startGroovy.bat, you can set it from 128MB to 512MB like this: ... @rem set GROOVY_OPTS="-Xmx128m" set GROOVY_OPTS="-Xmx512m" ... Found another way to do this on Windows without having to

Error Java Heap size in Android Studio 1.3.1

妖精的绣舞 提交于 2019-11-28 10:18:13
I recently updated Android Studio from 1.2 to 1.3.1 . After updating Gradle Sync failed message is started showing up to increase Java heap size. Following is the screenshot of error. TIA Go to your Android Studio Folder Where it is installed. There is File stduio.exe and studio64.exe with file type of VMOPTIONS , open it in notepad you will see Something like this: -Xms512m -Xmx1280m -XX:MaxPermSize=350m -XX:ReservedCodeCacheSize=225m -XX:+UseConcMarkSweepGC -XX:SoftRefLRUPolicyMSPerMB=50 -ea -Djna.nosys=true -Djna.boot.library.path= -Djna.debug_load=true -Djna.debug_load.jna=true -Dsun.io

Tomcat: adjust memory proportions

▼魔方 西西 提交于 2019-11-28 09:39:39
问题 I have a Tomcat instance running on a Windows 2008 Server with 4GB of RAM. The server is dedicated to this one application, so I would quite like to be able to dedicate most of the RAM to Tomcat. My Tomcat setup currently has the following java options: -Xms256m -Xmx1600m I'd like to increase the amount of RAM, preferably up to about 3GB (obviously I know how to do that, just increase the -Xmx value). However, Tomcat refuses to start up if I increase the maximum heap space beyond 1600MB.