Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [memory-management]

The tag has no usage guidance.

-1
votes
1answer
21 views

Why object non-optional ignore its weak property? [Swift] [closed]

I have 2 classes Car and Owner, they have weak preference to each other. After I assign nil to one object. That object is still not deallocated. Like code bellow, as far as I understand object vinfast ...
3
votes
3answers
50 views

Machine code: How can an OS prevent user-level programs from accessing each other's memory? [duplicate]

Okay, I’ve done a lot of research on this, but I can’t seem to wrap my head around it. Essentially, the question is as follows: How can an operating system prevent a machine instruction from a user-...
3
votes
2answers
66 views

What is the avantage of having memory mapped I/O?

I can't make out what is the avantage of it comparing with the port designed I/O Is it faster? Is it more reliable? Is it cheaper?
0
votes
1answer
13 views

Memory Mapping Segment

I read that "Memory Mapping Segment"/"memory mapped file" is a segment of the virtual memory of a process, where a file or file-like Ressource is loaded into. It is for high performance file I/O. I ...
0
votes
0answers
11 views

Operating system - physical address protection [duplicate]

Considering a system with no logical address ( that is all memory addresses used are direct physical address), can we have a memory scheme which can prevent one process from over writing the code/data ...
1
vote
0answers
23 views

Recurrence Relation for Column Major Form of multidimensional array

A two dimensional array is stored in column major form in memory if the elements are stored in the following sequence $$A[0][0] A[1][0] A[2][0]...A[n_1-1][0] ... A[0][1] A[1][1] ... A[n_1-1][1] .... A[...
1
vote
0answers
12 views

What happens when a file is being moved/copied to another location at the same hard drive?

I've got a few questions about how hard-drives works with information that I haven't been able to find the answers to anywhere, so I figured I'd give this a shot instead. I know the basics on how ...
0
votes
0answers
13 views

Number of memory cycles stolen for transferring one word

The storage area of a disk has the innermost diameter of 10 cm and outermost diameter of 20 cm. The maximum storage density of the disk is 1400 bits/cm. The disk rotates at a speed of 4200 RPM. The ...
2
votes
1answer
94 views

How does hashed inverted page table work?

I understand hash function and inverted page table, but then the book I read describes something called hashed inverted page table (use hash to accelerate the finding because IPT is large), with TLB ...
0
votes
0answers
10 views

If the number of pages exceeds the number of frames, how can the process finish using Virtual Memory?

Mapping is not for paging, is it? For instance if we have 12 pages and 8 frames. If 7 out of these 12 pages are loaded into the main memory, how can the process terminate?
1
vote
0answers
49 views

pool of free page frames OS

I read that in a paging scheme memory management, some os's have a paging daemon that wakes up periodically to inspect the memory of the RAM. This is to ensure that modified pages can be scheduled to ...
0
votes
1answer
31 views

How can a user process even try to access a memory location its not allowed to when it doesn't have access to page table?

So is it even possible for a user process to even try to access a physical memory location that does not belong to it and therefore getting an error by operating system? because for example with a 32 ...
1
vote
1answer
277 views

How pictures and videos are usually loaded in Memory? [closed]

Lets assume I'm talking about Jpeg and Mp4 and a general video player(not sure if different ones load it differently, if they do please tell) So do video players (process) usually load the entire ...
1
vote
1answer
34 views

What is the mathematical principle of buddy algorithm?

The buddy algorithm is: The buddy for any block of size $2^k$ is another block of the same size, and with the same page frame number except that the kth bit is ...
2
votes
1answer
32 views

Page cache and its relationship to page table

I was reading about the page cache Page cache - the cache in memory for files, but I couldn't find the answer to my question. Does the page table have anything to do with, or maintain any entries, for ...
1
vote
1answer
39 views

Can a process run if there's not enough space for minimum pages?

I'm studying OS and I came up with this scenario where the OS works with a paging scheme and virtual memory, and a process wants to start running, but in memory, there's not enough space to allocate ...
1
vote
3answers
93 views

Can computers lose information?

I've heard that computers cannot forget anything, but yesterday my teacher told me that a computer can lose its memory from getting very hot. Is that true that computers can lose information? How and ...
0
votes
1answer
137 views

How does the TLB identify a particular process?

I have read that the translation lookaside buffer (TLB) is implemented in hardware and stores the page numbers and the corresponding frame numbers for faster lookups. Now suppose there are two ...
0
votes
0answers
54 views

Cache mapping problem

Okay.I have problem about cache mapping. Here is the problem . Memory size is 1 MB Byte addresable Cache block size is 16 Bytes. Cache size is 64kb Since memory is 1 mb=2**20 Bytes. So we need ...
5
votes
1answer
29 views

How does cache partitioning prevent covert/side-channel attacks?

In a report on an open-source separation kernel (Muen kernel) I was reading, in the future work section, it says that cache coloring can be implemented to prevent covert/side-channel attacks. It is ...
1
vote
0answers
212 views

Cache Hit or miss

Asume 512 Bytes direct-mapped cache with 64 Byte cache blocks (cache line size), is empty at the beginning and below given set of physical addresses are referred by CPU in the given order. At each ...
0
votes
1answer
280 views

What does “higher order address bits” and “lower order address bits” mean?

"Assume a system with 4 GB virtual memory and 1 GB physical memory with 32 bit addresses. if the page size is 4 KB, How many bits will be allocated as the Higher Order Address bits and Lower Order ...
0
votes
0answers
203 views

Determine the main memory size using cache line and cache size

Assume a computer architecture with 32 bit address.The system has been designed with 1MB cache which comes with 64KB cache line(cache block size). 1.What is the maximum main memory capacity this ...
0
votes
0answers
11 views

Populating Page-Table Maps

I'm working on a coursework that requires making a model showing address translation of a RAM that operates on the basis of a segment-page scheme. So my confusion stems from the fact that every ...
0
votes
1answer
38 views

How to keep track of changes done to concurrent stacks?

I am writing a small RPN calculator that works on some stacks concurrently. For example, if I have two functions: ...
0
votes
1answer
80 views

Virtual Memory and processes

In a Operating System, who decides which parts of a program (or task) has to be stored in the virtual memory and which in the RAM ?
4
votes
0answers
62 views

Alternatives to the stack and heap-based memory models

The stack seems to be an optimization of memory use for a specific application. Whereas the heap is a general model that works in all cases. Wondering if there are any other types of models of ...
0
votes
1answer
277 views

Why can't OSes swap out processes that are waiting for I/O?

In the book, Operating System Concepts, 9th Edition, there is this paragraph that I don't quite wrap my head around. Swapping is constrained by other factors as well. If we want to swap a process,...
2
votes
0answers
18 views

Sweeping integrated into memory allocation: Why only fixed size objects?

In our language design book, it is mentioned that GC sweep can be integrated into allocation, such that when you call malloc for example, you sweep until you find a ...
5
votes
1answer
176 views

Is there any mechanism where the kernel portion of an OS in memory may also be swapped?

I'm recently learning the part of I/O buffering of operating system and according to the book I use, When a user process issues an I/O request, the OS assigns a buffer in the system portion of ...
1
vote
1answer
109 views

Coalescing by register allocation

I have a rough idea of what coalescing in terms of memory access by threads is, but now, when learning about compilers, the term coalescing also appears when talking about register allocation. In my ...
1
vote
2answers
45 views

What is the difference between a page and thread?

"Each process that is executed is divided into blocks of same size, called pages." "Thread is a part of process being executed." Are pages and threads both part(s) of process? Whats the difference ...
0
votes
1answer
54 views

How does a buffer overrun corrupt the return address?

I got stuck on the following note while reading a paper about computer security: The stack mixes program data and control data – by overrunning buffers on the stack we can corrupt the return ...
0
votes
1answer
92 views

Virtual Memory: “Page Table or Page Tables?”

I am having a bit of a tough time grasping whether a computer system contains several page tables or just one page table. Some sources speak of page tables in plural others in singular. ...
1
vote
1answer
2k views

What does 'relocation' mean?

I am reading about Base & Bounds memory protection mechanism, and I noticed the use of the term 'relocation' in the context of ...
0
votes
2answers
612 views

Does MMU contain and manage CPU caches?

I read about Virtual Memory in various CS references, however I'm still not sure whether CPU caches such as TLB, L1 and L2 are ...
0
votes
1answer
31 views

Does having more bus in the computer increasing speed? [closed]

Whát i mention here is for having 2x bus will increasing 2x memory access speed like 3x will have 3x memory access speed like that !
2
votes
1answer
368 views

Where are 'Base & Bounds' registers located?

I read about virtual memory from L08/CS152 of U.C Berkeley and used to deep dive into the details of VM hardware implementation, yet didn't find any document or figure on the course specifying where ...
11
votes
3answers
2k views

What does “map” mean?

I have encountered the term many times, in various CS education materials: L2 CS162 (UC Berkeley): Memory-mapped I/O L4 CS162 (UC Berkeley): Memory mapped files L24 CS61 (UC Berkeley): “...
0
votes
1answer
209 views

How memory remapping of physical address space that is above 4GB RAM works? [closed]

I have a query regarding the below information in http://duartes.org/gustavo/blog/post/motherboard-chipsets-memory-map/ "In 64-bit mode it is possible to use physical addresses above the total RAM in ...
0
votes
1answer
317 views

Virtual Memory - Non-contiguous Memory Allocation

I'm studying for my operating systems final, and one question that my professor asked that I can't seem to find the answer to is the following: "Why does virtual memory use non-contiguous memory ...
14
votes
1answer
3k views

If the virtual address space can be larger than the physical address space, how are the address mappings stored in memory?

Let's say we are working with a system that has 40 physical address bits. The total physical address space (assuming byte-addressable memory) is $2^{40}$ bytes, or 1 TiB. And if virtual addresses are ...
1
vote
0answers
268 views

Difference between inverted page table and a standard one?

I know that for standard page tables each process would have its own page table and for inverted the OS would have it. But other than this what are the main differences between a standard page table ...
0
votes
1answer
283 views

Effectiveness of TLB

This is a book question: Suppose that a machine has 48-bit virtual addresses and 32-bit physical addresses. Suppose this same system has a TLB (Translation Lookaside Buffer) with 32 ...
1
vote
2answers
92 views

Why are programs executed in main memory?

Why are programs kept in main memory for execution? As per my understanding, we need a memory management scheme to manage several processes in the main memory. These things can be done in secondary ...
1
vote
1answer
327 views

External fragmentation in fixed size partitioning

Can external fragmentation occur in fixed size partitioning ? I searched everywhere but couldn't find a sentence which says external fragmentation is not possible in fixed size partitioning. Please ...
-1
votes
1answer
173 views

How does computer keep track of Empty and used memory space?

Where does computer store used and unused memory address to access it ?Are base address and length or ending address stored side by side?
-1
votes
1answer
678 views

Advantages of segmented paging over pure paging

As we know segmented paging is an improvement over segmentation and paging but I am having some doubts regarding the memory overhead of these three system.It is clear that segmentation need less ...
1
vote
0answers
72 views

Design considerations for a language to support automatic parallelization [closed]

Automatic parallelization isn't a new thing by any means, and lots of questions have been asked about whether Java or C or C++ or a host of other languages or specific compilers (gcc 5 v 6, clang, ...
1
vote
3answers
97 views

Why do modern processors need a runtime stack?

Professor said that modern processor needs runtime stack. But he didn't explain the reason. Why is the runtime stack required in the modern processors?