heap

Heap Corruption trying to add elements to existing std::vector

这一生的挚爱 提交于 2019-12-13 07:35:43
问题 I have an std::vector containing elements of class BoundingBox ( std::vector<BoundingBox> , which I call BB_Array ). First, i create this vector using a function that I will simplify here: BB_Array* Detector::generateCandidateRegions(BB_Array* candidates){ BB_Array* result = new BB_Array(); // without new here, i get segmentation fault BB_Array tempResult; // apply tests to candidates and add the good ones to tempResult ... // ... using tempResult.push_back((*candidates)[i]); for (int i=0; i

looking for an inverted heap in python

邮差的信 提交于 2019-12-13 07:31:49
问题 I'd like to comb off the n largest extremes from a timeseries. heapq works perfectly for the nlargest def nlargest(series, n): count = 0 heap = [] for e in series: if count < n: count+=1 hp.heappush(heap, e) else: # keeps heap size fixed hp.heappushpop(heap,e) ''' note: heap[0] is smallest ''' return heap but what about the n smallest? Note that i want a subset of the original series, so heapify and reversing the order won't work. What I'd like is essentially to overload the comparison

Why is the stack address lower than that of heap in Visual C++?

三世轮回 提交于 2019-12-13 05:23:09
问题 As we all know, stack address are higher than heap addresses in Process Address Space . But when I wrote a program to verify it in VS2010, I got some trouble. The stack has an address lower than heap , even lower than that of Data Segment. the program is shown as follows: #include "stdafx.h" #include "malloc.h" static int g_a=123; int g_b=123; int main() { static int a=123; int b=123; float c[10]={0}; int *p1=(int*)malloc(sizeof(int)); int *p2=(int *)malloc(5*sizeof(int)); } Here are their

Could not reserve enough space for object heap in grails

家住魔仙堡 提交于 2019-12-13 04:32:56
问题 I am working on GGTS 3.5 and Grails version 2.3.7. When i run my project, we are facing an issue with Heap size. Windows 7 32 bit; RAM: 3gb. Java 1.7 . I set below environment variables as well. GRAILS_OPTS = -XX:MaxPermSize=1024m -Xmx1024m -server JAVA_OPTS = -XX:MaxPermSize=1024m -Xmx1024m -server and changed my GRAILS_OPTS in start grails file. But still facing the same issue. I have just started working in java and grails, please help me out. Many thanks in advance. Error Desc: Loading

Android Studio error “Java heap space”

非 Y 不嫁゛ 提交于 2019-12-13 02:44:15
问题 I'm developing an Android app in Android Studio and today suddenly it doesn't compile when I press the "Run" button. The error is this: Error:Execution failed for task ':app:packageInstantRunResourcesDebug'. Java heap space I've tried cleaning the project and rebuilding it but it didn't work. 回答1: I have tried many solutions but finally, this helped me to solve this problem : - distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip use this line in your "gradle

Heap error in C#

倖福魔咒の 提交于 2019-12-13 02:33:41
问题 I have a C# program to test a C++/CLI assembly (this assembly is a wrapper to a native C++ dll) and I'm getting following error message: Unhandled exception at 0x50f8fd85 (msvcr90d.dll) in TestKeyManagerApp.exe: 0xC0000005: Access violation writing location 0x00000000. last position in debug mode: dbgheap.c (Visual studio 2008 output) if (pHead == NULL) { *errno_tmp = ENOMEM; <----- ACCESS VIOLATION RTCCALLBACK(_RTC_FuncCheckSet_hook,(1)); } I create an object of the assembly class once

Java: What is the purpose of creating an object in the heap with no reference

拥有回忆 提交于 2019-12-13 02:25:26
问题 The code I came across was this, an object is created and it’s method was called: public static void main(String[] args) { new DemoSoap().request(); //<----how come there is no reference? } private void request() { try { // Build a SOAP message to send to an output stream. SOAPMessage msg = create_soap_message(); // Inject the appropriate information into the message. // In this case, only the (optional) message header is used // and the body is empty. SOAPEnvelope env = msg.getSOAPPart()

create-react-app max_old_space_size not working

冷暖自知 提交于 2019-12-13 02:22:53
问题 Facing an issue while build or run my project with create-react-app. It throws js heap out of memory error. > yarn build yarn run v1.6.0 $ react-scripts build Creating an optimized production build... <--- Last few GCs ---> [8792:0000021D06B28B70] 1492086 ms: Mark-sweep 1401.7 (1716.2) -> 1401.7 (1716.2) MB, 1474.4 / 0.0 ms allocation failure GC in old space requested [8792:0000021D06B28B70] 1493542 ms: Mark-sweep 1401.7 (1716.2) -> 1401.5 (1658.7) MB, 1455.7 / 0.0 ms last resort GC in old

Changing value of a heap element in C

大兔子大兔子 提交于 2019-12-13 01:27:14
问题 I have implemented a min heap in C. My heap is an array of structure. I have arranged the elements in heap according to the value of member 'length' in the structure. In my program I have to modify the 'length' of some members dynamically. After modifying this value, my heap has be reconstructed. I am finding difficulty in reconstruction part of this. My code: typedef struct edge{ int source; int dest; int length; }edge_st; typedef struct heap{ edge_st* edge[100]; int size; }heap; The code to

looking for Sorted Heap & Concurrent Queue in gs-collections library

别等时光非礼了梦想. 提交于 2019-12-12 22:10:54
问题 Three questions: I was told the gs-collections library contains queue implementations but I can't find them in http://www.goldmansachs.com/gs-collections/javadoc/5.1.0/. do they exist? if so, which classes should I look at? Likewise for a sorted heap class (Not so much of a question) Does anyone have any experience with the gs-collections library? It's totally new to me, so if you have any experience and advice regarding which tasks it's particular good at please share Thanks in advance 回答1: