Most voted "heap" questions
The heap is the appropriate memory location to allocate many large objects, as this section of the program is much larger than the stack, and its size is limited only by the virtual memory available on your machine. If the question is not about "Heap", do not use this tag, even if you are using "Heap" in your project.
Learn more…22 questions
Sort by count of
-
217
votes4
answers41133
viewsWhat are they and where are the "stack" and "heap"?
What are these such stack and heap that so much is said about memory management? This is actually portions of memory as some people speak or is just an abstract concept to facilitate understanding…
-
17
votes2
answers6315
viewsHeap of Java memory
I would like a simple explanation of what heap memory of JVM? I searched on Google but had no clear enough answer.
-
17
votes1
answer484
viewsData access performance in heap and stack and object allocation
Data access in the stack is faster than in heap? And why allocate an object to heap?
-
7
votes2
answers1416
viewsWhat is the behavior of static variables in . NET?
What is the behavior of static variables in . NET? These are stored in heap or in the stack?
-
7
votes1
answer1156
viewsWhat is the functionality of the "heapify" method of the heapq module?
What is the method for heapify library heapq python? How could I use it in a list, for example?
-
6
votes1
answer1924
viewsMessage "Could not reserve enough space for Object heap" in JVM
So I wanted to know the limitation for memory allocation to the JVM depending on the operating system and processor architecture. If, as you set it, you lower the maximum value of the perm-size to a…
-
6
votes1
answer132
viewsAre variables randomly allocated in memory?
In a book about C, in which I started studying variables, it said that variables were randomly put into memory, for example: int a; int b; printf("a = %d\n", &a); --> 5000 (endereço) (%d ao…
-
5
votes1
answer107
viewsIf everything in C# inherits from Object, why aren’t all types by reference?
If, for example, a struct type inherits from the class System.ValueType (who inherits from System.Object), why it, and the other types by value, are not allocated in the heap? By making a Boxing, we…
-
4
votes1
answer275
viewsWhat’s faster: Stack or Heap allocation?
This question may sound elementary but it has given me a good debate with a co-worker. I whenever I can make allocations on Stack because for me the growth of Stack is constant in time. And already…
-
3
votes1
answer122
viewsC# How to change value within Parallel.Foreach
I am performing a processing inside an array of strings (lines of a file . txt). For performance reasons, I’m using the Parallel.ForEach, but there was a need to change the values of some lines that…
-
2
votes1
answer84
viewsStoring a character array within a heap memory
I would like to know how to order a set of characters in a vector, and store them in memory heap.
-
2
votes3
answers82
viewsShould I allocate the member of the date structure as well?
Assuming the following structure: typedef struct lnode{ struct lnode *next; void *data; int id; }Lnode; Let’s say I want to keep one Lnode in the heap: Lnode *exp = malloc(sizeof(*exp)); I must now…
-
2
votes1
answer233
viewsOperation of the push method
In the code: import heapq class PriorityQueue: def __init__(self): self._queue = [] self._index = 0 def push(self, item, priority): heapq.heappush(self._queue, (-priority, self._index, item))…
-
2
votes1
answer221
viewsHow to use a class array as a pointer?
How do I use a class array as a pointer? I tried several ways, but C++ didn’t let you compile by generating errors. An example of class(It’s just one example, the class I need to use is thousands of…
-
1
votes1
answer350
viewshow to write a name using pointers
I need a program that uses memory heap to store any name. input we have the number of characters of the name and then the name, for example: 32 Josefina Penacho Reis dos Santos The output must be…
-
1
votes2
answers629
viewsHow to implement a priority queue that still meets other requirements?
I need to implement a priority queue, this queue in addition to the priority, needs to take into account some other requirements, such as switching between services and professionals, and of course…
-
1
votes1
answer90
viewsOperator overload = in c++
I’m having a problem implementing operator overload = in a heap class. Heap& Heap::operator=(const Heap& outro){ printf("chamei atribuição\n"); this->escreve(); Heap *h = new Heap(outro);…
-
1
votes2
answers138
viewsAre variables declared within blocks or subprograms dynamically allocated?
I’m reading the book "Algorithms and Programming with Examples in Pascal and C" and in it there are two paragraphs that left me in doubt, are they: Two alternative forms are offered by some…
-
0
votes0
answers212
viewsPDF Java memory overflow
Hello, good night. I’m having memory overflow problems in a java application when generating +/- 1000 PDF’s in a loop. In this application, to generate the PDF, a proprietary framework is used,…
-
0
votes0
answers143
viewsPosition of first element in Heap object
I’m in doubt about the priority line heap, with regard to inserting items in that list. Every heap starts by inserting from the element vetor[1]? Or you must insert from vetor[0]? 'Cause I got a…
-
-1
votes1
answer63
viewsWhy can I still access a variable in the heap even after the function is over?
A while ago I learned about heap and stack, I was testing some codes when I came across a strange behavior in heap see; #include <iostream> using namespace std; void Test1(int *i[]); void…
-
-2
votes1
answer148
viewsAllocating to the heap is so bad? If so, why would we use it?
Whenever I deal with languages that are able to allocate in the heap, I hear advice that this is slow and should be avoided. I’ve read several responses that talk about heap and stack, but have…
heapasked 3 years, 10 months ago NinjaTroll 1,752