Memory allocation is an operation of giving a program a block of memory.
Questions tagged [allocation]
1869 questions
0
votes
1 answer
How much memory and vcore allocated on hadoop YARN?
I want to ask, in hadoop yarn both on yarn-site.xml and mapred-site.xml there are property like minimum and maximum memory or vcore. I'm little bit confuse, actually in real how much memory and vcore allocated because on configuration we only write…

Kenny Basuki
- 625
- 4
- 11
- 27
0
votes
1 answer
Frame Allocation
I have two operating system related questions. My first one relates to frame allocation, more specifically equal allocation for a specific situation. The situation I have is that there are 200 free frames in memory and two processes which are trying…

Ramirez77
- 107
- 5
0
votes
4 answers
Printing the field before initialising it seems to print it after I initialise it
Could you please explain me this strange behaviour?
public class Car {
private int wheels;
public Car(int wheels) {
System.out.println("Before: " + wheels); // prints 3 before initialisation
this.wheels = wheels;
…

nbro
- 15,395
- 32
- 113
- 196
0
votes
2 answers
How To Allocate Memory For MultiDimensional Array in a Constructor Class in Java
When I create my array field as private double [] balance, I can allocate memory in the constructor class by balance= new double []{n,u,m,b,e,r,s};. However, when I try to allocate memory for a multidimensional array it will not work. The error in…

MissKP
- 1
0
votes
1 answer
C storage allocator usage?
In KR C Programming Language there is a storage allocator described but how do I use it? How can I improve it? what algotihms are there available? Is this a trivial version of malloc that is shown?
#define ALLOCSIZE 10000
static char…

Niklas Rosencrantz
- 25,640
- 75
- 229
- 424
0
votes
1 answer
is it ok to construct from a stl container which has a different allocator?
Say I have
std::vector A
std::vector B
I am using __offload::shared_allocator as allocator2 in Cilk Plus for offloading from Host CPU to Xeon Phi coprocessor
Can I…

yidiyidawu
- 303
- 1
- 3
- 12
0
votes
1 answer
Transfer .txt file to dynamic memory allocated by malloc
So, I've been searching this around StackOverflow for awhile now but none of the semi-related posts are a solution to mine, so I hope anyone can help :)
So what I wanna do is transfer a .txt file, that has the following content on it:
1 5 8
2 4 6…

Zetsuno
- 97
- 1
- 9
0
votes
2 answers
Declaring and initializing very large arrays on the heap
I have an array of about 66,000 elements, with each element being a POD struct of integral data types. This array is constant and will never change, so my original thought was to just put it in as a constant global variable.
I declared it in a…

mock_blatt
- 955
- 5
- 11
0
votes
1 answer
Trying to read file into dynamically allocated 2d array
I am trying to read a file into a dynamically allocated 2d array but I keep getting the same line printed out. The file I am putting into this code is a .txt with 1000 lines. The print at the end is to check if the array is getting the right data.…

sukurity
- 55
- 3
- 8
0
votes
2 answers
Where is the sense in allocating more space than required for an array
In contest programming, I've often been recommended to allocate more space than required for more-than-zero-dimensional data types, i.e. arrays or arrays of arrays, than actually required by the limits of the task.
E.g. for the simple DP task of…

s3lph
- 4,575
- 4
- 21
- 38
0
votes
1 answer
im having trouble getting my best fit allocation to get more then a few to allocate
Hi i am programming a mock operating system for a class and am trying to use the best fit allocation technique to allocate memory for the processes.
my list has two parameters a num_units and a process_id there are 128 units to start and process id…
0
votes
2 answers
Java object memory allocation of not accessed variables
I have a java class which contains three integers A, B and C.
I use this class on both, a client and a server application.
But I never access A on the server side.
Would Java even allocate memory for A when I create an object of that class on the…

Franz Deschler
- 2,456
- 5
- 25
- 39
0
votes
1 answer
Dynamic object array increase
I'm building a domino game and trying to make a function that adds a Stone to a pile.
This is the Stone class:
class Stone
{
public:
Stone(){ left = 0; right = 0; };
Stone(int x, int y){ left = x; right = y; };
void turnStone();
bool…

Adam Mo
- 75
- 7
0
votes
1 answer
Allocation memory using realloc, exact size I need
I am writing a code in C, and I have a problem allocating exactly the size I need.
I use a while loop and realloc function , and when the loop is done I have a spare memory (+1 than what I need). and I cant find a way to allocate the exact size I…

user3819295
- 861
- 6
- 19
0
votes
1 answer
Delete[] array breaks my C++ program
I have had this issue for a while now. Every time my grow function calls the delete line, the program breaks. It doesn't give me an error besides it has reached a break point. I have not found a solution to this online during my Google searches. Can…

greg-mora
- 29
- 5