heap

How to increase android virtual device max heap size?

血红的双手。 提交于 2020-01-03 08:41:12
问题 I would like to increase the android virtual device map heap size with Eclipse. I tried to set the Max VM application heap size to 128 in the Eclipse AVD Manager, but it does not work, the line Runtime.getRuntime().maxMemory()/(1024*1024); always returns 48, no matter the set heap size. Device ram size is set to 512. Selected target is Android 4.1.2 (API Level 16). Moreover, I have set android:largeHeap="true" in the manifest file. Is there a limit to max heap size (is 128MiB to much ?), or

Why does the JVM Heap Usage Max as reported by JMX change over time?

浪子不回头ぞ 提交于 2020-01-03 08:08:14
问题 My JVM heap max is configured at 8GB on the name node for one of my hadoop clusters. When I monitor that JVM using JMX, the reported maximum is constantly fluctuating, as shown in the attached image. http://highlycaffeinated.com/assets/images/heapmax.png I only see this behavior on one (the most active) of my hadoop clusters. On the other clusters the reported maximum stays fixed at the configured value. Any ideas why the reported maximum would change? Update: The java version is "1.6.0_20"

What is the difference between A.length and A.heap-size?

你说的曾经没有我的故事 提交于 2020-01-03 06:58:09
问题 I have a question about heap sort. It state in an Algorithms book that A.heap-size<= A.length I don’t understand the difference between the two. If an array represents a heap, why is there a possibility that A.heap-size is less than A.length . I know that A.heap-size represents the number of elements inside a heap, so why is it not completely only equal to the number of items inside an array? 回答1: The invariant of heap sort is that the first k elements of the n-element array are a heap on the

Where variables of a function is store? on stack or heap?

若如初见. 提交于 2020-01-03 04:15:29
问题 When a program calls a function, in which type of data structure is memory allocated for the variables in that function? Heap or stack? why? In my opinion it should store on stack because they are not necessarily reference types. But Where I read the answer, it is stated that they store on heap and free after function returns a value. 回答1: It is a little more complicated than that and the fact that the stack and heap are used are really implementation details. It makes more sense to talk

memory allocation for objects

空扰寡人 提交于 2020-01-02 04:41:28
问题 When we instantiate a variable in c++ like int x within a function(i.e. x is a local variable), it is allocated on top of stack of the process. But if we do int *x= new int , the space is provided in heap. So, my questions are: What about objects of different classes (classes provided by c++ or user defined)? Where are their objects instantiated? For example: Let Employee is a class and we declare Employee emp; . Where is emp given space-> on stack or in heap? If the declaration int a[4] is

Is Heap considered an Abstract Data Type?

折月煮酒 提交于 2020-01-02 01:45:07
问题 I'm taking Data-Structure course and got a little confused about what is considered to be an ADT (Abstract Data Type) and what isn't (and if it isn't an ADT then it must be the implementation?). Specifically, I'm talking about Heap. I've read in Wikipedia that " heap is a specialized tree-based data structure" does that mean it is an ADT? if so, then I can't understand the following line, also from Wikipedia "The heap is one maximally efficient implementation of an abstract data type called a

Why use a flat list in heapsort?

自作多情 提交于 2020-01-01 20:49:06
问题 In heapsort , the data is stored in something called a " heap ". Almost all the implementations I've seen use a flat list for the data structure. Can someone explain to me why this is? Why not use nested arrays or an instance of a binary Tree ? Isn't explicit better than implicit? Is it because of implementation difficulties like traversing the structure, or something else? 回答1: If you want to see how heapsort can be implemented in Python then look no further than the standard library module

OutOfMemoryError: Java Heap Space. How can I fix this error that happens in a recursive method?

牧云@^-^@ 提交于 2020-01-01 19:02:47
问题 I have a Java application that parses pdf files in a directory and its subdirectories and creates a database using the information found in the files. Everything was fine when I was using the program on around 900 files or so (which create a SQLite database with multiple tables, some of wihch contain 150k rows). Now I'm trying to run my program on a larger set of data (around 2000 files) and at some point I get "OutOfMemoryError: Java Heap space". I changed the following line in my jdev.conf

Why does a BufferedImage require so much memory beyond the size of its data array?

女生的网名这么多〃 提交于 2020-01-01 12:36:10
问题 I'm trying to determine how much heap any given TYPE_INT_ARGB BufferedImage will use so that, for a program which is doing some image processing, I can set a reasonable max heap based on the size of image we feed it. I wrote the following program as a test, which I then used to determine the least maximum heap under which it would run without an OutOfMemoryError : import java.awt.image.BufferedImage; public class Test { public static void main(String[] args) { final int w = Integer.parseInt

64-bit java won't allocate more than 2GB of heap memory

独自空忆成欢 提交于 2020-01-01 05:17:32
问题 I'm running my program from eclipse and using 64-bit java, but I still can't get it to allocate more than 2GB of memory. I'm running some benchmarks so I need a lot of memory. I have this in my eclipse.ini: -Xmx8g I want it to use all my memory. Could this be due to a 32-bit version of eclipse? I'm not sure what I have for eclipse. I've tried sending in -Xmx8g to VMArgs when running the program. I'm running 64-bit windows 7 and a 64-bit JRE. 回答1: In the run configuration screen, go to