Questions tagged [memory-management]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
3
votes
2answers
43 views

Why are primitive types stored in a stack in systems level software?

Firstly 2 disclaimers, I am very new to the concept of a stack at a low level. I've only encountered it because I'm learning rust and the docs mention it. Secondly, I am aware of another similar ...
0
votes
1answer
20 views

Making sense out of byte-order in text

I have stumbled about the way a text file is saved by the OS. I have typed: printf "ab" | hexdump and the output was: 6261 which are the letters in reversed ...
1
vote
3answers
109 views

Relation between size of address bus and memory size; memory Segmentation in 8086

My question is related to memory segmentation in 8086. I learnt that, 8086 has a 20 bit address bus. And so it can address 2^20 different addresses. Which means it has an memory size of 2^20, i.e, ...
0
votes
3answers
77 views

Does RAM get an indication of data size required

Pre-information: I'm sure someone has asked something along these lines, but no matter how I word it, I can't seem to find a definitive answer Question: Does RAM get some kind of indication as to ...
0
votes
0answers
42 views

When a weaker computer wins

Consider the following algorithm: run algorithm A until a solution or out of memory run algorithm B Then if A does not solve the problem, a computer with less memory has an advantage. This could be ...
0
votes
0answers
16 views

Another feasible way to implement multi-level page table?

The advantage of a multi-level page table is that we can swap the inner-level page tables to some secondary storage. If however we want quick access to the whole address space, we have to keep all ...
0
votes
0answers
18 views

Internal & external fragmentation

Given five memory partitions 200kB, 600kB, 250kB, 450kB and 500kB which are fixed and in order. processes of 212kB, 517kB, 115kB and 430kB in order. In First-Fit order 212 kB --> 600 kB partition (...
0
votes
0answers
10 views

working set bits in working set approximation

I am looking at the example pdf from Cornell found here: https://www.cs.cornell.edu/courses/cs4410/2016su/slides/lecture13.pdf Also reading OS Concepts 10e Chapter 10 but it does not go into detail. ...
0
votes
1answer
12 views

Schedule management optimizer

I had this idea of program tohelp me in my everyday life. We both work and don't live in the same city. I was wondering how to make a program that calculate, depending on the work scheduleand the ...
1
vote
0answers
19 views

Journey of a process from compilation to execution [closed]

I am reading operating system, and after reading some topics (Processes, Main Memory management) I got somewhat confused. I have knowledge about certain things but I am not able to combine and ...
1
vote
1answer
40 views

Is it possible for a syscall to pack together different places in memory?

While programming with buffers like uint8_t* in C++ I often arrive at situations on where I'm forced to do copies. For example, if I receive packets in chuncks from ...
0
votes
0answers
16 views

External fragmentation of memory

Im trying to calculate the external fragmentation of a memory with the content UFFFUUFFUU where U is used, and F is free. Im confused as to how to do this, when i dont know the number that Used is ...
0
votes
0answers
24 views

Doubt in effective memory access time in case of n level paging + TLB

I am getting confused with calculation of EEMAT(Effective memory access time). I decided to close the book and think on my own and make an equation. Please see whther this is correct or not. I thought ...
1
vote
1answer
23 views

Paging - access less than a page of memory

I'm having a bit of trouble understanding how less than a page of memory can be used. From what I understand, memory is given out in page size chunks - say pages are 4096 bytes, and 4 bytes are ...
0
votes
0answers
16 views

How does increase in main memory affects cache performance?

I know advantages of increase in main memory like more pages , better Spatial locality of reference , more number of processes in main memory and increase in CPU performance. What can be disadvantages ...
1
vote
0answers
48 views

Given only TLB Lookup time, and memory access time, can the TLB hit rate be negative?

I'm given the following problem: TLB lookup time is given as 8ns and memory access time for a computer system is given as 40ns. What should be the TLB miss rate to achieve effective memory ...
1
vote
3answers
79 views

Can a programming language be designed to use a fixed amount of memory?

I have been toying around with the idea of creating a programming language as a side-project, specifically trying to get extreme performance out of a machine. I have been thinking about the ...
0
votes
0answers
12 views

What happen if the L1 cache has the address entry with write_back attribute. Will that address be available in L2 cache?

I have the TLB entry for a particular address. This address has write-back attributes in both L1 cache and L2 cache. My queries are: 1> if L1 cache entry has write-back, can it be write-back in L2? 2> ...
0
votes
1answer
49 views

Distinction between paging and segmentation?

In my operating systems textbook, there is a paragraph which states: As for the contents of each PTE, we have a number of different bits in there worth understanding at some level. A valid bit is ...
1
vote
2answers
52 views

Is concept of virtual memory about memory isolation or about ability to swap? Or both?

Most reading I found about virtual memory, such as http://www.linux-tutorial.info/modules.php?name=MContent&pageid=89 or https://en.wikipedia.org/wiki/Virtual_memory always state that virtual ...
1
vote
2answers
107 views

Why do operating systems freeze?

I am currently writing from a computer on which a VM has just frozen due to exhausted RAM. I am obviously no expert in the field of operating systems but i know that they implement certain memory ...
0
votes
1answer
60 views

Is logical address generated by CPU and MMU same if Physical and Virtual address space are same?

The system has same physical and virtual address space i.e. 32-bit. Are the logical address generated by CPU and address generated by MMU same?
0
votes
2answers
82 views

Understanding memory mapping conceptually

I've already read several blogs and questions on stack exchange, but I'm unable to grasp what the real drawbacks of memory mapped files are. I see the following are frequently listed: You can't ...
0
votes
0answers
66 views

How many page-table entries can fit into TLB space

I am looking to calculate how many page-table entries can fit into a corresponding TLB space (Translation Look-aside Buffer ). I just want to make sure I am getting the calculation right, as I fear I ...
0
votes
1answer
70 views

Converting physical address to logical

In 8-bit address space there are 16 pages and the page table stores: 68792EA51BD3CF04 (hex) The physical address is 39h, what is the corresponding logical address? I have literally no idea what to ...
0
votes
0answers
184 views

AMAT using Local miss rate, global miss rate, local hit rate, global hit rate

Consider the following scenario as shown in image: I have summarized the above Memory layout in terms of Miss rates and hit rates: ...
2
votes
0answers
11 views

Region-based memory management for recursive type

In the chapter 4 of Pierce's TAPL which discusses the implementation of untyped arithmetic expressions, the author said The most important [for the implementation requirements] are automatic ...
0
votes
0answers
75 views

Need help understanding set-associative cache

The problem I'm trying to solve is: A set-associative cache consists of 64 lines, or slots, divided into four-line sets. Main memory contains 4K blocks of 128 words each. Show the format of main ...
1
vote
1answer
62 views

How to remove objects from an array most efficiently?

I am wondering if I can rearrange an array faster when I would like to delete more than one object. You are given a List: 1 2 2 3 4 5 7 And now you want to delete every "2" in the list. So what I ...
1
vote
1answer
63 views

Is stack based memory allocation memory allocated at run time or compile time?

In stack-based memory allocation: is memory allocated at compile time? If so, then how can we allocate space for, say, n number of recursive calls made during the execution of the program?
0
votes
0answers
30 views

Map a 16Bits to 32 bits address

So, I'm working on a 16 bits CPU Emulator with these settings: Instructions are 4 Bytes long; 24 bits of an instruction are for data purposes, but only 16 bits are used for memory addressing. All ...
0
votes
0answers
21 views

Distribution of number of references to other object in an object

I been thinking about an improvement to a garbage collector (details not important for this question) and wished to know how often does a object have no reference to other objects. Clearly this will ...
2
votes
1answer
105 views

Is it reasonable to model row buffers in DRAM corresponding to the same bank ID as one big row buffer?

I'm creating a simple row buffer simulator to go along with a simple cache simulator in order to count hits and misses in the row buffer. Whenever a cache block isn't in the cache I want to go look ...
0
votes
1answer
183 views

Why does paging not have external fragmentation?

I have read that paging does not suffer from external fragmentation as the frames and the pages are all of the equal sizes, but when we store a last level page table in a frame at that time it may not ...
1
vote
1answer
142 views

Space complexity of breadth-first search

I read that breadth-first search has to store (at most) $1+b+b^2+···+b^d$ nodes in memory ---more than depth-first search---, where $d$ is the depth of a solution, and $b$ is the branching factor. ...
1
vote
1answer
61 views

Clarification on interplay between cache line size and read/write sizes

Say that you have cache lines with the size of 64 bytes and a set-associative or directly mapped cache. Let's also say that the word size is 8 bytes. According to my understanding, we use a number ...
0
votes
0answers
23 views

Calculate the size of memory protection register

One of the methods for virtual memory protection is using a register of accessible pages for every active process. How many bits should the length of this register be, considering: physical memory ...
0
votes
2answers
26 views

Do the “virtual memory”s mentioned in the 2 articles refer to different things?

I've read the following 2 articles explaining the difference between virtual memory and physical memory. One thing that I found ...
1
vote
0answers
26 views

General notion of memory for a computational model

I have just started studying Michael Sipser's Theory of Computation, studying various computational models such as FAs, PDAs et cetera. In the book, the term "memory" was often used,as in the case of ...
-1
votes
1answer
32 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
95 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
1k 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
114 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 ...
1
vote
0answers
39 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
17 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 ...
2
votes
1answer
587 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 ...
1
vote
0answers
258 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
246 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
344 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
47 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 ...

1
2 3 4 5