heap

Can I get Tomcat running as a service to dump heap?

怎甘沉沦 提交于 2019-12-21 03:57:18
问题 I am attempting to have Tomcat, which is currently running as a service on a Windows 2003 box, dump heap on an OutOfMemoryError . (Tomcat is running Hudson, which is reporting a heap space problem at the tail end of my build. Running the build manually produces no such error. The Hudson guys need a heap dump to get started.) As instructed elsewhere, I've told the Apache Service Monitor to configure the JVM it uses to run Tomcat to dump heap when an OutOfMemoryError is encountered by adding

C++ Implementing Heap Median Function

核能气质少年 提交于 2019-12-21 02:42:10
问题 Following the answer found here, https://stackoverflow.com/a/10931091/1311773, I am attempting to implement two heaps so I can calculate a running median. I'm unfamiliar with heaps, and am not sure where to begin implementing this function described here. http://programmingpraxis.com/2012/05/29/streaming-median/ My goal is to create a small test program that calculates running medians efficiently, so as the list grows the median doesn't need to be recalculated from scratch. Using two heaps, I

recursion using only heap area

≯℡__Kan透↙ 提交于 2019-12-21 02:34:10
问题 Are there examples of recursion using only heap area? 回答1: In C, function call-based recursion always uses the stack, almost by definition. If you are willing to convert your recursion to iteration, then it is possible to use only heap space, but that isn't really recursion. You would do so by implementing a stack in the heap. Certain problems can use tail recursion, which repeatedly overwrites the same area of the stack. 回答2: You could do something crazy like malloc a new area, turn off

What are the negative consequences of turning debug heap off? (_NO_DEBUG_HEAP==1)

不羁岁月 提交于 2019-12-21 00:43:05
问题 The initial phase of my program loads in significant amounts of data into STL containers. I found that it was taking several minutes before I could reach the real meat of my program. After some searching, I found that I could set _NO_DEBUG_HEAP==1 within my VS2012 Configuration Properties->Debugging->Environment variable...turning off utilization of the windows debug heap. This gave me a 10x improvement in debugging speed. I have not yet found any description what what debugging functionality

What are the negative consequences of turning debug heap off? (_NO_DEBUG_HEAP==1)

為{幸葍}努か 提交于 2019-12-21 00:41:47
问题 The initial phase of my program loads in significant amounts of data into STL containers. I found that it was taking several minutes before I could reach the real meat of my program. After some searching, I found that I could set _NO_DEBUG_HEAP==1 within my VS2012 Configuration Properties->Debugging->Environment variable...turning off utilization of the windows debug heap. This gave me a 10x improvement in debugging speed. I have not yet found any description what what debugging functionality

Analyze Tomcat Heap in detail on a production System

心已入冬 提交于 2019-12-20 20:16:12
问题 Having analyzed a light-load web application running in tomcat, using JMX Console, it turns out the "PS Old Gen" is growing slowly but constant. It starts with 200MB and grows around 80MB/Hour. CPU is not an issue, it runs at 0-1% on average, but somewhere it leaks memory, so it will become unstable some days after deployment. How do i find out what objects are allocated on the heap? Are there any good tutorials or tools you know? 回答1: You could try jmap, one of the JDK Development Tools. You

Do references get updated when Garbage Collectors move data in heap?

不羁岁月 提交于 2019-12-20 17:29:59
问题 I read that GC (Garbage Collectors) moves data in Heap for performance reasons, which I don't quite understand why since it is random access memory, maybe for better sequential access but I wonder if references in Stack get updated when such a move occurs in Heap. But maybe the offset address remains the same but other parts of data get moved by Garbage Collectors, I am not sure though. I think this question pertains to implementation detail since not all garbage collectors may perform such

Comparator for min-heap in C++

流过昼夜 提交于 2019-12-20 12:06:23
问题 I am trying to make a min-heap 1 of long s in C++ using the STL make_heap , etc., but my comparator doesn't seem to be comparing properly. The following is my current comparator: struct greater1{ bool operator()(const long& a,const long& b) const{ return a>b; } }; However, when I do std::pop_heap(humble.begin(),humble.end(),g); where g is an instance of greater1 and humble is a heap who makes [9,15,15,25] when sort_heap is called, I get a 15 popped. Is my comparator correct? what might be

Change priority of items in a priority queue

五迷三道 提交于 2019-12-20 10:46:33
问题 Using Scala 2.9 to implement a kind of Dijkstra algorithm (pseudo code) val queue = new PriorityQueue queue.insert(...) while (!queue.isEmpty) { val u = queue.extractMin queue.foreach { v => if (condition(u, v)) queue.decreaseKey(v, newPriority) } } I'd like to change priority of an item in Scala's collection.mutable.PriorityQueue . Therefore tried to remove item change priority reinsert into queue. But I can't find a method to either update priority or remove a specific item (not necessarily

Where are variables in a closure stored - stack or heap?

二次信任 提交于 2019-12-20 10:33:36
问题 Like the following codes: var foo = function() { var a = 1; // closure var return function() { // closure fun console.log(a); } }; var bar = foo(); When foo exits(or say, returns), we know that the variable a will not be destroyed and remains in memory(that's why closure works). So my problem is where does the the variable a store, stack or heap? 回答1: A closure is just an evolution of the concept of the stack. The stack is used to separate/isolate scope when functions are called. When a