When updating my battery display for my Pebble watchface, I get the battery level into int s_battery_level, run it through my toString function (which works 100% of the time, I've tested it), and then append a % and a null terminator, just for good m
Imagine I have have a struct with 9 properties, which return a value type as its result and in that struct I also have a property which returns a reference type : IEnumerable like this: public IEnumerable<KeyValuePair<String, String>> Dostuff
I have an array that represents a Max Heap. For example 84 81 41 79 17 38 33 15 61 6 so the root is max. Each mid tier node at index i can have at most two children. They would be at 2*i+1 and 2*i+2. How can i print this heap out in a level by level
I am using a Max-Heap to store objects of type Song. A song has a title and a rating as shown in the Song class. I want the Song object to be compared by rating so that the highest rated songs are displayed first. If songs have the same rating then t
1.) I'm having difficulty testing me heap class. When I try to print my heap, it's giving me code instead of the array. I tried using toString() and DeeptoString() and neither worked. 2.) In my updateValue method. I realize that it doesn't know what
How can I calculate heap chunk size from raw bytes read from memory. I tried below thing. 0:001> !heap Index Address Name Debugging options enabled 1: 00500000 2: 00280000 3: 008f0000 4: 00ab0000 5: 00cc0000 0:001> !heap -a 00500000 .. .. Heap entri
I am trying to generate arrays of type double, which can reach sizes in excess of 60 million. Moreover, I need to iteratively generate larger and larger arrays (begin with say 20000, iterate through my code x no. of times successively inflating my ar
I've been working on implementing a recursive version of heap's algorithm. Here is the link to the pseudocode: http://en.wikipedia.org/wiki/Heap%27s_algorithm Everything has been going fine until I get to the recursive part. I know I haven't put in s
I am learning about operating systems and the thing that I do not understand exactly are heaps and stacks. I know the benefits and how each works, but in the case of dynamic languages I can not figure out how is the stack allocated. In static typed l
I'm trying to create and sort a heap using this array in Java. I keep getting an array index out of bounds exception in my maxHeap function. The code seems to make sense to me, so I'm not sure where the error is coming from. Anyone know what I'm doin
Here is an implementation of a Heap in java without using array but I have some problem in inserting data in it for example when i insert 1,3,2,5,8 it inserts 5,8 two times one as subtree of 3 and another one as subtree of 2. public class Heap { priv
Most people seem to suggest setting the Java/Tomcat heap memory size for Tomcat6 by editing the /usr/share/tomcat6/bin/catalina.sh file, and adding something like: # Set specific memory requirements for Tomcat6 (for server with ~512MB RAM). CATALINA_
I am running 64-bit windows 7 with 4GB of RAM. I have 32-bit java I am trying to run a graph search algorithm in eclipse. I commented absolutely everything out except for a simple println("Hello World") After a lot of tinkering, I found that I c
I understand that a min heap is the structure that the class uses because of its efficiency. It seems to me that when unsorted data is given to a PQ it sorts it into a heap. BUT when it is fed ascending elements according to the compareTo method it w
I want to design a container C of element E. E has 2 attributes (priority, name), All elements in container have unique 'name' I want to support following operations on this container C as effeciently as possible. insert:- inserts element1(name1, pri
What is the complexity of the addAll method of PriorityQueue. Does it add one element at a time resulting in O(n log n) or does it use a build heap process that creates a heap out of unordered elements in O(n) time?Javadoc seems to imply that addAll
I'd like to use java to work with a data structure that's going to end up over 100 GB. I need to write and read from the thing in 1:1 ratio, as many times per second as possible. In Java form it's a HashMap>. Can I keep and operate on it in disk as i
I have one problem with java heap memory. I developed one client server application in java which is run as a windows service it requires more than 512MB of memory. I have 2GB of RAM but when I run my application it throws an exception Out of memory
I'm new to Windows programming and I've just "lost" two hours hunting a bug which everyone seems aware of: you cannot create an object on the heap in a DLL and destroy it in another DLL (or in the main program). I'm almost sure that on Linux/Uni
Is it possible to see contents of stack and heap after every line of execution. I want to see it as it will give clear idea about memory allocation and deallocation in .Net. With your If any document or link which will clear my doubts with your answe
I have been learning managed pointers lately and ran into the following scenario. I am implementing a model/controller class for a game view. My view, will render things in the model. Pretty straight forward. In my main function, I instantiate all th
I have a fairly memory intensive process that can cause the heap size to grow near its limits (like 24 in this case). However, when that process ends, and the Allocated memory (as listed in the DDMS Heap tool and in a heap dump) is far far lower like
I know this is a strange question, but really I'm very excited to know the answer. How do you destroy Objects in .Net, and give memory back to the heap?Short Answer System.GC.Collect(); is suppose to force the garbage collection to run but I've heard
(Note that when I say "JVM", I really mean "Hotspot", and I'm running the latest Java 1.6 update.) Example situation: My JVM is running with -Xmx set to 1gb. Currently, the heap has 500mb allocated, of which 450mb is used. The program
I just read this statement in a java book saying Objects in java reside on a heap. Is a heap used because it is the best way to store data and retrieve data fast ? I only have an idea about data structures being a beginner. I mean why not stack or so
I'm writing an app in C using win32 API. When I try to enlarge the size of my array, using the HeapRealloc() function, it changes my current values in the array, instead of copying them. The code I use to reallocate memory: BOOL ChangeFeedArraySize(U
I'm writing a qt-based c++ application and i need to be able to detect memory fragmentation in order to check if the current system can actually sustain the memory load: the program load a big image (15/21 megapixels are the norm) in memory and then
I have a java programme than when a button is clicked it updates the image on screen to the according image. this will work for the first 15 or so clicks then it causes a java heapspace error. I think it is because of the way I am updating the jpanel
I know you can set max heap size at startup using -Xmx but is it possible to change it dynamically during runtime? Is there any tool or (undocumented) api which will allow me to do that?No, it is not possible.
Is there a way to define a macro (or something similar) that would allow objects to be allocated on the stack or on the heap, cleanly? eg. Current code: A a; a.someFunc(); The simplest suggestion might be the following, but as you can see below, it's