Questions tagged [memory-management]
The memory-management tag has no usage guidance.
317
questions
1
vote
1
answer
44
views
Are they talking about virtual memory in this article?
I am reading this Wikipedia article:
https://en.wikipedia.org/wiki/Memory_segmentation
And I am in this paragraph:
Segmentation with paging
Instead of a memory location, the segment information ...
1
vote
1
answer
16
views
Memory addresses requested by CPU vs Memory Address Provided to DRAM
So, i just got through studying DRAM architecture. I learned that a row address, column address, bank number etc are provided to the DRAM during a read operation. Based on the address provided, 64 ...
2
votes
2
answers
79
views
Memory Question
Say we're back in the 1950s and our clunky computer has a $1$ kilobyte memory. $1$ kilobyte is $1024$ bytes, which is $8192$ bits. When we consider the entire available storage space, there are $2^{...
1
vote
0
answers
35
views
Who and how generate the virtual/logical addresses? Confusion if it's the compiler, the linker, the loader
I know that when I compile a program and then I inspect with objdump, I have addresses. These are relative addresses.
But if it's a C program and I printf with <...
2
votes
1
answer
39
views
Problem with cache and memory from university class
In my university class, I received this homework assignment on computer architecture, but I don't know how to solve it. I already know that the correct answer is 0, but I don't understand why. Could ...
0
votes
1
answer
27
views
Thread safety due to no runtime allocation of memory, why?
I was watching a presentation related to the MuJoCo simulator (and other topics which were more relevant for the presentation itself) and at one moment in the presentation it is mentioned that MuJoCo ...
0
votes
1
answer
19
views
Cache Miss in First Private Cache but Hit in Shared LEvel 2 Cache: Does it Result in a Penalty?
In the context of Shared Memory Multiprocessor (SMP) systems with different cache levels, if a cache miss occurs in the first private cache but is followed by a hit in the second shared cache, would ...
0
votes
1
answer
46
views
What is the hit rate of the cache when executing this code?
C++ code:
int main()
{
short int arr[4][4];
for (int i = 0; i < 8; i++)
{
for (int j = 0; j < 8; j++)
{
arr[i][j] = i+j;
}
}
return 0;
}
Is there ...
1
vote
1
answer
43
views
How to find the free memory addresses in RAM?
I am currently trying to build a simple computer in Minecraft (8-bit data, 6-bit addresses, no paging or segmentation), with redstone, where I can make run simple programs written similarly to code in ...
0
votes
1
answer
64
views
Roles of 80386 MMU Paging Unit and similarity with modern CPU MMU
While searching for the structure of the MMU, I found the image below (80386 Internal Architecture).
I have three questions.
Q1. I'd like to know the roles of 'Adder', 'Page Cache', and 'Control and ...
0
votes
0
answers
20
views
If the register size and the address bus are equal so do we need those segementation register to segment our memory?
In 8086, as i know we need those segementation register to segment our memory because the address bus is 20 bit and register size is 16. So, If the register size and the address bus are equal and we ...
0
votes
0
answers
35
views
Neural networks as building blocks of a computer
I think I have developed a logic circuit which by using combinational logic and flip flops learns to perform the XNOR logic between 2 bits.It is a kind of state machine. Suppose we built a computer ...
0
votes
1
answer
29
views
Why when we use DMA , Read/Write operations on I/O devices are faster?
I am wondering why are read/write operations on I/O devices much faster when we use DMA?I must be that when using DMA we have 1 less clock cycle to access the local buffer of a IO device since it is ...
0
votes
0
answers
19
views
Secondary Memory Data Structures and allocation strategies for intermediate query results
Despite a huge amount of literature regarding table representation and indexing in secondary memory (also including database books), I found no information on how relational databases represent ...
1
vote
0
answers
56
views
How is the physical address calculated in Page tables?
Taking an example, say we have Page size = 4KB, Page Table Entry = 4B, Physical Address Space requires 36 bits
In 3-level multi-paging, let's say the number of entries in the level 3 page table is 2^9 ...
1
vote
2
answers
89
views
Why is `3[arr]` notation of accessing elements in array is not used?
Today, I came across the notation 3[arr] in C++, and I was surprised to find out that it's a valid way to access array elements. For example:
...
1
vote
2
answers
272
views
How do you bit-shift in RISC-V?
In the following video on computer organization:
https://youtu.be/DoR505t8-7I?t=114
the instructor displays the following:
and says that the hex string 0xFFFFFF00 ...
0
votes
0
answers
24
views
What if the size of the logical address is not power of two?
If the logical address and the page size are power of two, then we can separate the virtual address into two parts: page number and offset. Is this still valid if the virtual address is not power of ...
0
votes
1
answer
48
views
Associative memory addressing
I would like to understand better how associative memory works.In associative memory we have the tag and the actual data being stored.The tag describes where the data came from but what does this mean ...
0
votes
0
answers
22
views
Physical memory address space
When you address physical memory, in the kernel, is it just another value like 0xf78f9 just like virtual addresses (and the only thing that is different is that the ...
1
vote
1
answer
56
views
Disk addressing
I am wondering how disk addresses are accessed from a program. From my understanding, the two main facilities are programmed I/O (instructions) and memory-mapped I/O (simply loads and stores). The ...
0
votes
1
answer
49
views
Memory (physical addressing)
From my understanding, physical memory (main memory -- DRAM) is addressed differently than disk. This is all a bit of an abstraction to me, and I am hoping to make my understanding more concrete.
...
0
votes
1
answer
102
views
Page allocation for a program
When my professor explained how the OS handles memory, he described demand paging, and how when a process starts up, the code page with the first instruction is loaded into memory, and everything else ...
0
votes
2
answers
108
views
Why does Python behave so absurdly when dealing with numbers with decimal points?
r1 and r2 both are assigned 0.05 initially. If r1 is incremented by 0.01 in this way "r1 = r1 +0.01" we have 0.060000000000000005 as answer not 0.06.
0
votes
0
answers
118
views
How to calculate page number of pages and page size for multilevel paging?
I have the following virtual address:
+---------+----------+----------+
+ 7 Bit x | 13 Bit y | Offset d +
+---------+----------+----------+
I now have the ...
1
vote
1
answer
171
views
How does non-DMA transfers really work?
I recently discussed DMA and non-DMA with my OS professor. Here is my current understanding:
disk controller has its own CPU, maybe own ISA, tiny program that simply handles reading from the disk (...
1
vote
1
answer
41
views
How is the memory address structured when the number of blocks per cache set is not a power of 2?
When it comes to defining the memory address structure given the RAM size, cache size, and other parameters such as the cache block size..., we can have the following generalization:
$$Address = TAG|...
0
votes
0
answers
68
views
Memory management with bitmaps
I am reading Tanenbaum's Modern operating systems. I am not able to understand what he means by last line in the attached image. He says that the run may straddle word boundaries in the bitmap. What ...
2
votes
4
answers
152
views
Best C++ STL container to store bodies in an N-body simulation?
I am writing an N-body simulation in C++ that has to be able to deal with large N ($N \le 10^6$).
Everything has been going well so far, but now that I have started to code in collisions between ...
0
votes
2
answers
148
views
Is there an adress in the hard disk for each virtual adress?
Is it so that for each virtual adress there exists an adress in the hard disk? But the hard disk can be larger than the virtual memory?
EDIT: Or can some virtual adresses always map to physical, and ...
0
votes
0
answers
45
views
How does the computer keep track of which physical pages are used?
My book(link) says that if the computer tries to access a virtual memory page that is on the hard-disc it loads that page into physical memory. But how does the computer keep track of which physical ...
0
votes
2
answers
52
views
Does the computer change the content of the virtual adress
My book(digital design and computer architecture ARM edition) explains loads and stores like this:
To perform a load or store, the processor must first translate the
virtual adress to a physical ...
5
votes
3
answers
2k
views
automatic memory allocation
Global variables are given fixed addresses in main memory by the C compiler, called static memory allocation. Function local variables are created on the stack, this is called automatic memory ...
0
votes
1
answer
290
views
What is the relationship between virtual address and physical address?
I am recently studying the operating system, and I found the paging system a little bit confusing, for example, what will happen when there is a 52-bit virtual address and a 40-bit physical address, ...
0
votes
2
answers
389
views
How many bits are needed to reference physical vs virtual addresses?
I trying to learn about virtual memory at the moment and one of the explanations I've look at has a diagram like below. You can see that 32 bit virtual addresses are used so the virtual address space ...
1
vote
1
answer
594
views
Page/Frame VS Block
I am bit confused on these terminologies.
While studying Paging of Operating System we study about Page and Frame.
Size of one Frame of Main Memory = Size of one Page of a Process
While studying ...
0
votes
2
answers
297
views
If a process needs more RAM, does the Page size simply get bigger or does it get a new page?
Let's say I have a Operating System with 4KB page size, but I need to allocate 8kb of memory for all the variables. Does the Process get new page (second one) or does the current page table simply get ...
1
vote
1
answer
896
views
How are processor instructions stored in RAM?
I've recently been designing a simple 8-bit microprocessor, similar to the Intel 8008. It doesn't make use of anything advanced as pipelining, as my knowledge isn't at that level yet to know how to ...
0
votes
0
answers
51
views
How hardware write a byte in memory?
I want to know how hardwares write a byte in memory?
If there is difference between writing process in RAM and ROM I would like to know as well.
Specially I want to know:
Is hardware writes values ...
1
vote
1
answer
163
views
Are there any "fast" algorithms for defragmenting memory?
This is about memory, not files or filesystems.
So in a typical process, imagine you have a string "Hello world" that later gets changed to "Hello". Or a list of 100 objects later ...
1
vote
3
answers
43
views
On load estimation of memory consumption of program, is it possible?
In the book "Fundamentos de sistemas operativos" (Gunnar Wolf, Esteban Ruiz, Federico Bergero, Erwin Meza p.254) it says:
Al cargar un programa el sistema operativo calcula cuánta memoria ...
0
votes
1
answer
41
views
Bitvector for Memory Allocation
Lets say a system has 1TB of memory and 4kB blocks. How many MB of memory do we need if we want to store a bitvector to represent the current memory allocation situation with a bitvector?
Bitvector: a ...
1
vote
0
answers
57
views
Understanding maps file in /proc directory for a process
In linux, when I access /proc for a particular program it shows memory mapping for the program in maps file.
Something like this:
I wanted to know what is this [stack] memory mapped to i.e the kernel ...
2
votes
1
answer
367
views
Virtual and physical address spaces in address binding
I just need to check my understanding regrading two points .As was stated in the textbook "Operating systems concept " :
The compile-time and load-time address-binding methods generate
...
0
votes
0
answers
159
views
Definition of the term "access efficiency" in the context of computer systems
In a two-level virtual memory, the memory access time for main memory, $t_M=10^{−8}$ sec, and the memory access time for the secondary memory, $t_D=10^{−3}$ sec. What must be the hit ratio, $H$ such ...
0
votes
1
answer
44
views
Can a program span on 0 memory cells? If so, where is it hosted? (where it "sits down")?
In this question post, one of the answers is:
...
0
votes
2
answers
69
views
Can a software program be stored in just one memory cell?
I would define a software program as at least one line of code stored in at least one computer system's memory cell.
Can a software program be stored in just one memory cell or rather (due to binary ...
0
votes
0
answers
51
views
Why PRAM and not PROM?
I read:
NVRAM is the updated Mac terminology for PRAM and is short for
Non-Volatile RAM.
Plus, I know that there are 2 types of main memory RAM and ROM while the first is Volatile the second isn't.
...
1
vote
2
answers
107
views
How can I write 2^65 on my 64-bit computer?
This is possibly a very trivial question for this site.
If I have a 64-bit laptop that means 2^64 combinations in total are possible.
But I can even get $2^{(x>>>64)}$ on my laptop.
Now, it ...
3
votes
2
answers
808
views
What are pointers in low-level language like C
I was trying to understand pointers by watching YouTube videos. However, I could not understand
How do they work?
Why do we use them?
When do we use them?