heap

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

二次信任 提交于 2020-01-01 05:16:05
问题 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

Heap class in .NET [duplicate]

老子叫甜甜 提交于 2020-01-01 01:19:10
问题 This question already has answers here : Closed 9 years ago . Possible Duplicate: Fibonacci, Binary, or Binomial heap in c#? Is there any class like heap in .NET? I need some kind of collection from which I can retrieve min. element. I just want 3 methods: Add() RemoveMinElement() GetMinElement() I can't use sorted list because there keys has to be unique, and I might have several identical elements. 回答1: You could use SortedList or a SortedDictionary (see discussion below) with a custom key.

How do I Save the Heap (Dump to a File) in Eclipse?

你。 提交于 2019-12-31 23:08:08
问题 I'm getting this error when I run or debug my GA/AI from MyEclipse: Exception in thread "main" java.lang.OutOfMemoryError: Java heap space eclipse.ini looks like this: -showsplash com.genuitec.myeclipse.product --launcher.XXMaxPermSize 256m -vmargs -Xms128m -Xmx512m -Duser.language=en -XX:PermSize=128M -XX:MaxPermSize=256M MyEclipse is called like this: "C:\Program Files\MyEclipse 6.0\eclipse\eclipse.exe" -vm "C:\Program Files\MyEclipse 6.0\jre\bin\javaw.exe" -vmargs -Xms1448M -Xmx1448M

How do I Save the Heap (Dump to a File) in Eclipse?

孤街浪徒 提交于 2019-12-31 23:08:01
问题 I'm getting this error when I run or debug my GA/AI from MyEclipse: Exception in thread "main" java.lang.OutOfMemoryError: Java heap space eclipse.ini looks like this: -showsplash com.genuitec.myeclipse.product --launcher.XXMaxPermSize 256m -vmargs -Xms128m -Xmx512m -Duser.language=en -XX:PermSize=128M -XX:MaxPermSize=256M MyEclipse is called like this: "C:\Program Files\MyEclipse 6.0\eclipse\eclipse.exe" -vm "C:\Program Files\MyEclipse 6.0\jre\bin\javaw.exe" -vmargs -Xms1448M -Xmx1448M

Why is the default size of PermGen so small?

爱⌒轻易说出口 提交于 2019-12-31 10:49:33
问题 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?

c# structs/classes stack/heap control?

元气小坏坏 提交于 2019-12-31 09:04:51
问题 so in c++ it's very easy. you want whatever class/struct to be allocated on the heap, use new. if you want it on the stack, don't use new. in C# we always use the new keyword, and depending on whether it's a struct or a class it's allocated either on the stack or on the heap (structs go to the stack, classes to the heap) - and in some applications there can be a HUGE performance difference when changing the design such that only those objects go to the heap that really belong there. What I

c# structs/classes stack/heap control?

依然范特西╮ 提交于 2019-12-31 09:04:31
问题 so in c++ it's very easy. you want whatever class/struct to be allocated on the heap, use new. if you want it on the stack, don't use new. in C# we always use the new keyword, and depending on whether it's a struct or a class it's allocated either on the stack or on the heap (structs go to the stack, classes to the heap) - and in some applications there can be a HUGE performance difference when changing the design such that only those objects go to the heap that really belong there. What I

How to allocate arrays on the stack for performance gains?

廉价感情. 提交于 2019-12-31 07:45:06
问题 Some of the most optimal versions of functions like popcount and count consecutive zeros use table lookups to get the final answer. In C and C++ one can allocate arrays on the stack and access them quickly. Is there a way to do this in C# as well? As far as I know, stackalloc can only be used within functions and thus the array won't persist. I have a small lookup table that I'd like to be able to access as quickly as possible and thus would prefer to allocate it on the stack rather than heap

How to get inverse of a comparator in java

老子叫甜甜 提交于 2019-12-30 17:31:29
问题 In a method I receive a generic object E extends Comparable<E> as an argument. Now i want to create two priority queues.One which uses the comparator used by E and other queue which uses the opposite of comparator used by E(i.e. if E uses '<' then second queue must use '>='). Please hep me how to create two such queues. queue2=new PriorityQueue<E>(0,Collections.reverseOrder(e)); I am getting the error that reverseOrder is not applicable. please help 回答1: Look at Collections.reverseOrder. 回答2:

How does pointer comparison work in C? Is it ok to compare pointers that don't point to the same array?

倾然丶 夕夏残阳落幕 提交于 2019-12-30 08:05:42
问题 In K&R (The C Programming Language 2nd Edition) chapter 5 I read the following: First, pointers may be compared under certain circumstances. If p and q point to members of the same array, then relations like == , != , < , >= , etc. work properly. Which seems to imply that only pointers pointing to the same array can be compared. However when I tried this code char t = 't'; char *pt = &t; char x = 'x'; char *px = &x; printf("%d\n", pt > px); 1 is printed to the screen. First of all, I thought