heap-memory

Why isn't the allocated heap memory shrinking when usage is below MaxHeapFreeRatio?

筅森魡賤 提交于 2019-12-05 17:17:57
I have a java server task, which is hogging memory. For one I doubt it ever exceeded MinHeapFreeRatio, but that's speculation. It is more interesting that GC reduces the mature generation to roughly 2%, yet never reduces the allocated memory for the heap. Heap Configuration: MinHeapFreeRatio = 40 MaxHeapFreeRatio = 70 MaxHeapSize = 3221225472 (3072.0MB) NewSize = 268435456 (256.0MB) MaxNewSize = 268435456 (256.0MB) OldSize = 805306368 (768.0MB) NewRatio = 7 SurvivorRatio = 8 PermSize = 21757952 (20.75MB) MaxPermSize = 176160768 (168.0MB) Heap Usage: New Generation (Eden + 1 Survivor Space):

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

时光毁灭记忆、已成空白 提交于 2019-12-05 15:34:17
问题 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

Intellij heap size, Initial heap size set to a larger value than the maximum heap size

依然范特西╮ 提交于 2019-12-05 14:54:26
问题 I'm a beginner in Java, and I just started using Intellij as my IDE. When I use it, sometimes it's delayed. I changed my xms and xmx for larger heap size (xms = 1024, xmx = 2048), but it throws an error. So, I rolled it back. The error message was something like this: "Initial heap size set to a larger value than the maximum heap size". What is the problem? If possible, how do I increase maximum heap size? I'm using a laptop and it has 8GB memory. x64 Intellij.exe used. 回答1: If you are seeing

CLR Profiler and 0 Heap Statistics

拈花ヽ惹草 提交于 2019-12-05 12:06:50
Why would I get 0 for my heap statistics allocation for an ASP.NET MVC web application with CLR profiler? I was getting zeroes, but I think doing these two things solved the issue of zeroes: make sure you have "Allocations" checked in the "Profile" section and be sure to end the application before trying to see the profiling info. Either end it through CLR Profiler ("Kill Application") or from within the application itself. I believe both of those things were required to make it work for me. 来源: https://stackoverflow.com/questions/23376436/clr-profiler-and-0-heap-statistics

malloc like function using custom heap

我怕爱的太早我们不能终老 提交于 2019-12-05 11:04:44
What would be the best approach in C if I wish to construct malloc like functionality with a custom pre-allocated heap? My specific issue here is that I have a mmap-able (memory like) device which has been placed into my address space but I need to attain a more flexible way of using this memory to store objects which will be allocated and freed over time. I know that malloc, free and the other similar functions are used to perform this kind of allocation on the heap but is there any way to use the logic provided by this kind of function for its dynamic behaviour while providing my own address

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

泄露秘密 提交于 2019-12-05 10:27:44
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 following settings: -Dosgi.requiredJavaVersion=1.5 -XX:MaxPermSize=512m -Xms512m -Xmx1024m I do not

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

别等时光非礼了梦想. 提交于 2019-12-05 05:53:55
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=../resolver -Djava.library.path=../framework -Djavax.management.builder.initial=JBeanServerBuilder -Djavax.net

Return lazy iterator that depends on data allocated within the function

☆樱花仙子☆ 提交于 2019-12-05 05:00:15
I am new to Rust and reading The Rust Programming Language , and in the Error Handling section there is a "case study" describing a program to read data from a CSV file using the csv and rustc-serialize libraries (using getopts for argument parsing). The author writes a function search that steps through the rows of the csv file using a csv::Reader object and collect those entries whose 'city' field match a specified value into a vector and returns it. I've taken a slightly different approach than the author, but this should not affect my question. My (working) function looks like this: extern

Intellij heap size, Initial heap size set to a larger value than the maximum heap size

老子叫甜甜 提交于 2019-12-05 00:17:27
I'm a beginner in Java, and I just started using Intellij as my IDE. When I use it, sometimes it's delayed. I changed my xms and xmx for larger heap size (xms = 1024, xmx = 2048), but it throws an error. So, I rolled it back. The error message was something like this: "Initial heap size set to a larger value than the maximum heap size". What is the problem? If possible, how do I increase maximum heap size? I'm using a laptop and it has 8GB memory. x64 Intellij.exe used. If you are seeing this error in InteliJ after the 2019.2 update it is because the update changed the JVM XMX value to 2048m

How to statically identify dynamic heap allocation?

跟風遠走 提交于 2019-12-04 19:27:55
I'm about to remove "as many as possible" dynamic heap allocation in my application and I wonder how I can make sure I didn't miss anything. Currently I'm looking for a way to easily or even automatically tell, if any (or which) parts of the code might invoke the standard implementations of new / delete or malloc / free without having to dynamically trace allocations (i.e. via static code analysis or feedback from compiler/linker). It's easy to spot (or search for) code which directly calls new or malloc of course: int main() { auto s = new std::string(); delete s; } Just in case the