Top "Allocation" questions

Memory allocation is an operation of giving a program a block of memory.

Memory allocation of class objects

I have been asked this question in interview. Please help me find its answer. Suppose you have a class Employee. …

c# asp.net class memory allocation
Escape analysis in Java

As far as I know the JVM uses escape analysis for some performance optimisations like lock coarsening and lock elision. …

java stack allocation escape-analysis
Getting a stack overflow exception when declaring a large array

The following code is generating a stack overflow error for me int main(int argc, char* argv[]) { int sieve[2000000]; return 0; } …

c arrays memory stack allocation
Multithreaded Memory Allocators for C/C++

I currently have heavily multi-threaded server application, and I'm shopping around for a good multi-threaded memory allocator. So far I'm …

c++ c memory malloc allocation
checking for NULL before calling free

Many C code freeing pointers calls: if (p) free(p); But why? I thought C standard say the free function …

c allocation
To preallocate or not to preallocate lists in Python

When should and shouldn't I preallocate a list of lists in python? For example, I have a function that takes 2 …

python list obfuscation allocation
Reservation allocation algorithm

I am looking for algorithms for allocating reservations to resources. This could be Hotel reservations matched to available rooms - …

algorithm allocation
Declare large array on Stack

I am using Dev C++ to write a simulation program. For it, I need to declare a single dimensional array …

c++ arrays memory stack allocation
How to implement a memory heap

Wasn't exactly sure how to phrase the title, but the question is: I've heard of programmers allocating a large section …

c++ c memory heap allocation
When is array allocated on stack in c#?

I've been trying to figure out when things get allocated on stack and I can't figure out how would you …

c# arrays stack heap allocation