Questions tagged as 'heap'

2
answers

Java memory heap

I would like to explain in a simple way what is the heap of JVM memory? I researched Google but had no clear enough answer.     
asked by 13.10.2014 / 19:29
1
answer

What is the functionality of the "heapify" method of the heapq module?

What is the heapify method of the heapq library of Python? How could I use it in a list, for example?     
asked by 17.10.2017 / 03:35
1
answer

Message "Could not reserve enough space for object heap" in the JVM

So I wanted to know what the limitation is for memory allocation to the JVM depending on the operating system and processor architecture. If you configure it, lower the maximum value of the perm-size to a lower value, can you further increase th...
asked by 25.08.2014 / 19:30
2
answers

What is the behavior of static variables in .Net?

What is the behavior of static variables in .Net? Are these stored in the Heap or the Stack?     
asked by 04.08.2014 / 20:20
1
answer

Are variables allocated randomly in memory?

In a book about C, in which I started studying variables, I would say that the variables were randomly placed in memory, for example: int a; int b; printf("a = %d\n", &a); --> 5000 (endereço) (%d ao invés de %p para simplificar) printf...
asked by 02.11.2017 / 22:16
1
answer

What's Faster: Stack or Heap Allocation? [duplicate]

This question may sound elementary but it has generated a good debate with a co-worker. I can whenever I do allocations in Stack because for me the Stack growth is constant in time. And already the allocation performance in...
asked by 09.08.2017 / 09:18
1
answer

How to use a class array as a pointer?

How do I use a class array as a pointer? I tried in several ways, but C ++ would not let me compile errors. An example of the class (Just an example, the class I need to use is thousands of times larger than this) class Pessoas { private:...
asked by 11.12.2017 / 15:47
1
answer

Storing a vector of characters within a heap memory

I would like to know how to sort a character set into a vector, and store it in the heap memory.     
asked by 24.04.2015 / 18:43
1
answer

How the push method works

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)) self._inde...
asked by 20.10.2017 / 01:50
3
answers

Should I allocate the structure member date as well?

Assuming the following structure: typedef struct lnode{ struct lnode *next; void *data; int id; }Lnode; Let's say I want to store a Lnode in heap : Lnode *exp = malloc(sizeof(*exp)); Should I now also use malloc...
asked by 01.02.2016 / 17:36