heap-memory

Is TarArchiveInputStream buffered or unbuffered inputstream?

南笙酒味 提交于 2019-12-12 03:33:54
问题 Is TarArchiveInputStream buffered or unbuffered inputstream ? InputStream inputStream = new TarArchiveInputStream(new GZIPInputStream(new BufferedInputStream(new FileInputStream(file)))); Does this object of inputStream store the whole entire file internally into the heap memory? Or is it just a pointer to a file and stores nothing into the memory? 回答1: Based on the source code of commons-compress.jar ver 1.4 , What happens when we create an instance of TarArchiveInputStream? Apart from other

Why does heap size keep increasing?

别来无恙 提交于 2019-12-12 03:18:43
问题 I have an application that has a lot of ripple effects and animations. I tried going back and forth multiple screens, and also spam clicking buttons. I noticed that the heap size continuously goes up even though some screens have already been closed. When I checked the heap dump, the class with the highest Retained heap was the android.graphics.Bitmap class and points to all of the buttons I clicked that has a Ripple Effect. The Ripple Effects on the buttons are just simple ripples which uses

Adding a row to a large xlsx file (Out of Memory)

这一生的挚爱 提交于 2019-12-12 03:09:09
问题 The situation is as follows; I have a simple program which uses the Apache Poi Library to add one row of data at the end of the an exisiting xlsx file. See below File file = new File(input); XSSFWorkbook workbook = new XSSFWorkbook(file); XSSFSheet sheet = workbook.getSheetAt(0); XSSFRow row = sheet.createRow(sheet.getLastRowNum() + 1); After this I will iterate over the row and set the CellValues. But the problem is that on the second line of the code, as shown above, I get an out of memory

java 1.7.45 : How to get full heap dump of process instead of truncated dump

ε祈祈猫儿з 提交于 2019-12-12 01:25:47
问题 I am using below command to get heap dump jmap -dump:live,format=b,file=/tmp/heap2.bin <pid> VM opts: -Xms2g -Xmx4g -XX:+UseG1GC -XX:MaxGCPauseMillis=1500 -XX:G1HeapRegionSize=2 -XX:+PrintFlagsFinal -XX:ParallelGCThreads=4 -XX:ConcGCThreads=2 But this command generates 300+ MB bin heap dump file for process running with 1.2 GB memory ( 1.2 GB memory has been shown in RES column of top command) EDIT: I have removed :live option after @kdgregory suggestion but heap dump is not generated due to

HAA0502 Explicit new reference type allocation

≯℡__Kan透↙ 提交于 2019-12-11 16:08:54
问题 I have ASP.Net Core 2.1 , C# application. I am using Clr Heap Allocation Analyzer https://marketplace.visualstudio.com/items?itemName=MukulSabharwal.ClrHeapAllocationAnalyzer One of the methods looks as below Ex#1 public void ConfigureServices(IServiceCollection services) { services.AddSingleton<IPocoDynamo>(serviceProvider => { var pocoDynamo = new PocoDynamo(serviceProvider.GetRequieredService<IAmazonDynamoDB>()); pocoDynamo.SomeMethod(); return pocoDynamo; }); } Ex.#2 public async Task

boost::container::small_vector doesn't seem to allocate in-place

删除回忆录丶 提交于 2019-12-11 15:48:55
问题 To test my understanding of small_vector, I tried the sample program below, where I template the vector with an in-place size of 3 and populate the vector with 10 elements. I'd expect the first 3 elements to be stored in-place and the last 7 elements to be stored out-of-place on the free-store, but that doesn't seem to be the case when I observe the memory layout: all of the items seem to be stored contiguously and out-of-place, as with a regular std::vector . I tried various compilers

Heap allocation failing in user DLL/EXE

孤人 提交于 2019-12-11 15:07:55
问题 Properly linked DLLs and EXEs are supposed to have one freestore from which they all can allocate heap-based objects. Here is Chis Becke’s Answer in Who allocates heap to a DLL?: … it is the C++ runtime that is responsible for creating its freestore and deciding how to allocate it. Specifically, if you use the Dll runtime option, then a single dll - msvcrtxx.dll - manages a single freestore that is shared between all dll's, and the exe, that are linked against that dll Since this is true,

Optimizing java heap usage by String using StringBuffer , StringBuilder , String.intern()

时光怂恿深爱的人放手 提交于 2019-12-11 14:49:34
问题 I am monitoring the performance and CPU of a large java application , using VisualVM. When I look at its memory profile I see maximum heap (about 50%) is being used up by char arrays. Following is a screenshot of the memory profile: In the memory profile at any given time i see roughly about 9000 char[] objects. The application accepts a large file as input. The file roughly has about 80 lines each line consisting of 15-20 delimited config options. The application parses the file and stores

Setting memory on a custom heap

佐手、 提交于 2019-12-11 13:16:11
问题 Is it possible to take a heap handle from HeapCreate() and set all available memory to a certain value? I've tried enumerating the heap by region and setting it that way, but I get access violations. I basically want to set the memory in my heap to a custom value that I can use for debugging, before it's ultimately destroyed via HeapDestroy. 回答1: The short answer is "no, you can't fill the heap with a specific value". You could wrap your heap access functions with debug versions, for example

How can the JVM allocate memory for objects despite the possibility that they might later grow in size

天大地大妈咪最大 提交于 2019-12-11 11:01:33
问题 Consider we have a class Node in java like this: class Node{ Node prev; Node next; } when we create a new Node ( Node sample = new Node(); ) how does the JVM allocate enough memory for the object. Its size might change in the future. For example, later I can set sample.setPrev(new Node()) and so on. so if JVM considers indexes from 1000 to 2000 in memory for this sample object then it's size might change and the memory index 2001 might not be empty for our use. 回答1: The heap memory is used by