heap-memory

Running out of heap space

会有一股神秘感。 提交于 2019-12-03 16:27:22
问题 I am having a heap space problem. My program is simple. There are two actors (send & receive) "send" actor is passing 10000 objects per second to "receive", and receive publishes those objects. the receivers received object is being saved in the container but the container is being emptied every second. So no chance the container is running out of space. Now after 420000 objects my eclipse shoes an error saying " ioconsole updater has encountered problem" . And when i goto into details i see

Does C# System.String Instances Really End Up on the Heap?

寵の児 提交于 2019-12-03 13:08:23
问题 Let's consider some very simple C# code: static void Main(string[] args) { int i = 5; string s = "ABC"; bool b = false; } Jeffrey Richter's " CLR via C# " (Chapter 14) states that " The String type is derived immediately from Object, making it a reference type, and therefore, String objects (its array of characters) always live in the heap, never on a thread's stack ". Also referring to strings, on an example in the book quite similar to the one above: " The newobj IL instruction constructs a

unique_ptr heap and stack allocation

妖精的绣舞 提交于 2019-12-03 12:24:01
问题 Raw pointers can point to objects allocated on the stack or on the heap. Heap allocation example: // heap allocation int* rawPtr = new int(100); std::cout << *rawPtr << std::endl; // 100 Stack allocation example: int i = 100; int* rawPtr = &i; std::cout << *rawPtr << std::endl; // 100 Heap allocation using auto_ptr example: int* rawPtr = new int(100); std::unique_ptr<int> uPtr(rawPtr); std::cout << *uPtr << std::endl; // 100 Stack allocation using auto_ptr example: int i = 100; int* rawPtr =

Why Bitmap size is bigger in memory than on disk in Android?

非 Y 不嫁゛ 提交于 2019-12-03 05:51:00
问题 I have a 2448x3264 image on my SD card that consumes 1,667,072 bytes but when I load it as a Bitmap and calculate its size using getRowBytes()*getHeight() I end up with 15,980,544 bytes. Why does this happen and how can I calculate the actual size of the file? 回答1: That is because the image is compressed when it is on disk (stored in a JPG, PNG, or similar format). Once you load the image into memory, it is no longer compressed and takes up as much memory as is necessary for all the pixels

Play Framework - can not reserve enough space for object heap

无人久伴 提交于 2019-12-03 05:47:20
I made some modifications to my play project and when I try and run it I get errors. >play run Error occurred during initialization of VM Could not reserve enough space for object heap Error: Could not create the Java Virtual Machine. Error: A fatal exception has occured. Program will exit. Is this a common problem? I am fairly inexperienced with the play framework but I have ran my project several times before without encountering this error. Edit: Information regarding java version. >java -version java version "1.7.0_11" Java(TM) Runtime Environment (build 1.7.0_11-b21) Java HotSpot(TM)

Running out of heap space

廉价感情. 提交于 2019-12-03 04:55:33
I am having a heap space problem. My program is simple. There are two actors (send & receive) "send" actor is passing 10000 objects per second to "receive", and receive publishes those objects. the receivers received object is being saved in the container but the container is being emptied every second. So no chance the container is running out of space. Now after 420000 objects my eclipse shoes an error saying " ioconsole updater has encountered problem" . And when i goto into details i see the error Internal error :: Java heap space I have tried increasing the heap size. My Heap size is

How is heap and stack memories mananged, implemented, allocated [duplicate]

淺唱寂寞╮ 提交于 2019-12-03 03:57:07
Possible Duplicates: How is heap and stack memories mananged, implemented, allocated? Stack,Static and Heap in C++ In C/C++ we can store variables, functions, member functions, instances of a class either on a stack or a heap. How is each implemented? How is it managed (high level)? Does gcc preallocates a chunk of memory to be used for the stack and heap, and then doles out on request? Is original memory coming from RAM? Can a function be allocated on the heap instead of a stack? --Clarification-- I am really asking about implementation and management of heap and stack memories. After reading

How to shrink java heap space? [duplicate]

♀尐吖头ヾ 提交于 2019-12-03 03:10:39
This question already has an answer here: Is there a way to lower Java heap when not in use? 7 answers I have a Java console app that's processing big xml files using DOM. Basically it creates xml files from data it takes from the DB. Now, as you guess it's using large amount of memory but, to my surprise, it's not related to bad code but to "java heap space not shrinking". I tried running my app from Eclipse using these JVM params: -Xmx700m -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 i even added the -XX:-UseSerialGC as i found out that parallel GC ignores "MinHeap" and "MaxHeap" options.

Java stack and heap memory management

只愿长相守 提交于 2019-12-03 02:10:54
问题 I want to know how the memory is being allocated in the following program: public class MemoryClass { public static void main(final String[] args) { int i = 0; MemoryClass memoryClass = new MemoryClass(); memoryClass.myMethod(memoryClass); } private void myMethod(final Object obj) { int i = 1; String s = "HelloWorld!"; } } Now, as far as my understanding goes, the following diagram describes how the memory allocation takes place: In the above diagram, memory , obj and s , which are in the

Why is the default size of PermGen so small?

落爺英雄遲暮 提交于 2019-12-02 20:38:36
What would be the purpose of limiting the size of the Permgen space on a Java JVM? Why not always set it equal to the max heap size? Why does Java default to such a small number of 64MB? Are they trying to force people to notice permgen issues in their code by doing this? If my app uses 85MB of permgen, then it might be safe to set it to 96MB but why set it so small if its just really part of the main heap? Wouldn't it be efficient to allow the JVM to use as much PermGen as the heap allows? Conceptually to the programmer, you could argue that a "Permanent Generation" is largely pointless. If