Questions tagged [virtual-memory]
Virtual memory is a memory management technique developed for multitasking kernels.
1,156
questions
-1
votes
0
answers
14
views
MySQL DB server swap utilization is constant high
I am running MySQL database on Red Hat Enterprise Linux. It's swap utilization is constant high at around 84 percent and all of this is being used by mysqld process as reported by following command:
...
0
votes
1
answer
29
views
ReadProcessMemory() dont read pages with specific AllocationProtect values
I'm building a Memory Scanner and with some error handling I noticed that ReadProcessMemory() is reading 90% of process' pages, but the ones that have mbi.Protect value == 1 or 260 it fails and ...
0
votes
1
answer
61
views
Question about VirtualQueryEx() lpAdress variable
I am building a Memory Scanner to find malware strings in a process.
Btw, when I was searching about the VirtualQueryEx dll, I saw that people starts its variable lpAdress ( which is supposed to be ...
-1
votes
0
answers
52
views
Find the page offset of a logical address
I recently started to study memory and virtual memory, and I'm trying to get a better understanding of some topics:
Given the logical address 0xAEF9 (in hexadecimal) with a page size of 256 bytes, ...
0
votes
1
answer
28
views
VirtualQueryEx returning impossible mbi.RegionSize value in ctypes
I'm building a Memory Scanner and in the middle of it I use VirtualQueryEx to get the size in bytes of the process.
This is my VirtualQueryEx and MEMORY_BASIC_INFORMATION structure setups:
...
1
vote
2
answers
95
views
How to remap a kernel
This is a theoretical question as I can't seem to find any reference on how to do this.
I am writing a small kernel and I already have virtual memory working.
I have defined my memory map (taking ...
0
votes
1
answer
19
views
Am I reading the virtual addresses correctly?
I have been given a page table for a system with 12-bit virtual ad physical addresses and 256-byte pages.
Say I am given an virtual address (in hexadecimal) that reads 0x3E5.
Am I reading this ...
2
votes
1
answer
56
views
What's the benefit of unmapping a resource in DirectX12
In a past question DirectX12 Upload Synchronization D3D12_HEAP_TYPE_UPLOAD, I got into trouble unmaping an upload resource, using it in a command list and executing, then mapping again and ...
0
votes
0
answers
46
views
vm_mmap crashes work on certain aarch64 platforms
Say I have a PCI device with a bar whose address is 0x1f40000000
I want to map this bar using vm_mmap() to user space (from my linux kernel module).
On x86_64 I ran
addr = vm_mmap(file, 0, len, ...
1
vote
0
answers
66
views
Disabling WP bit in CR0 Register in 64 bit Mode
What I'm trying to do here is write to read-only kernel mode code belonging to the address space of ntoskrnl.exe but my machine keeps locking up and everything freezes which requires a reboot. Thanks ...
0
votes
0
answers
42
views
Mapping shared memory in /proc/pid/maps
I am starting to learn about Linux memory mapping and memory usage of a process. I starting reading /proc/pid/maps, and it have below informations. I understand the basic difference between them.
But ...
0
votes
1
answer
97
views
When exactly is the MMU accessed on x86?
Is it called during the execution of an instruction itself (after it has been fetched & decoded)?
Or does it happen beforehand (however is it possible until we know that something is a (virtual) ...
0
votes
1
answer
37
views
How come the allocation of virtual address spaces doesn't rob you of all virtual memory?
On a 32-bit computer, a virtual memory address is represented as an integer between 0 and 2^32. By virtue of being a 32-bit system, no address can be represented that's lower than 0 or higher than 2^...
1
vote
1
answer
53
views
Does memory allocation show up when opening "/proc/self/maps"?
I have just started learning about virtual memory and I don't understand if I can see the memory that I have allocated with mmap(). The 2 show_maps() print the same text. Shouldn't I also see the ...
3
votes
1
answer
91
views
Accessing a variable that crosses a MMU page boundary
I am learning X64 assembly language under Windows and MASM64 from the latest edition of the book "The art of 64 bit assembly language".
I have a question regarding that quote from the book:
...
0
votes
0
answers
16
views
Calculating number of page table entries given bits of virtual & physical memory addresses & each virtual page?
Is there any sort of formula to calculate the number of page table entries if I am given:
number of bits in address of virutal memory
number of bits in address of physical memory
size of each virtual ...
-2
votes
1
answer
30
views
Virtual memory in operating system
A interviewer asked me that if i have 1 TB RAM and 10 TB HDD . Is there a need to implement virtual memory or not?.
Please tell me the correct answer as i m finding different answers on internet.
0
votes
1
answer
53
views
Whats the maximum size of Virtual memory
I am new to the concept of virtual memory.
I will like to know whats the maximum space of memory a procces can use through virtual memory?
Is it available RAM + available swap space ??
(This question ...
0
votes
2
answers
26
views
CUDA Virtual memory on Windows - what is the handle type?
From the CUDA driver API documentation:
enum CUmemAllocationHandleType
Flags for specifying particular handle types
Values
CU_MEM_HANDLE_TYPE_NONE = 0x0
Does not allow any export mechanism.
...
0
votes
1
answer
52
views
How does linux implement PROT_NONE mode of mprotect on x64 platform?
The method mprotect have a PROT_NONE option to disable memory access. It means "The memory cannot be accessed at all"
I wonder how it is implemented on x86/x64 platform.
According to the ...
0
votes
0
answers
10
views
Which of the following will not be treated as a cloud service and What is the relationship between paging and virtual memory?
Question-1: Which of the following will not be treated as a cloud service?
A VM rented from open stack based organization
A mobile connecting to weather and map services
A LMS service taken from a ...
0
votes
0
answers
32
views
How to remap virtual memory to other adress in virtual memory in xv6?
I have a problem to solve. The problem is I have to change xv6 files to enable sharing of special structures (they contain only name size and address) between 2 processes. I've edited the fork ...
0
votes
1
answer
54
views
when java current memory does not reach max memory(defined by "Xmx"), is the remaining memory wasted?
when java current memory does not reach max memory(defined by "Xmx"), the remaining memory (=max-current) is free and not used by any other process?
By the way, I know about virtual memory, ...
0
votes
1
answer
65
views
Virtual memory and Heap
Good morning. I hope some can help me out understanding how one aspect of virtual memory works and how C behaves.
From what I understand, whenever we call malloc, C will add it to the heap, with the ...
0
votes
0
answers
25
views
Using page protection to surface pointer/iterator invalidation bugs
Context: A container class we are writing does not guarantee pointer/iterator stability over a certain operation, because the operation has to reallocate in rare circumstances. The danger is that ...
0
votes
0
answers
42
views
Are software isolated processes superior to virtual memory for process isolation?
So I've been building a small OS and thought a bit about the paging/virtual-memory concept. I believe it provides two distinctly different benefits:
(1) Just like how the processor has onboard cache, ...
0
votes
0
answers
34
views
How to understand the "Relaxing the monotonicity assumption"
CSAPP 9.93 Allocator Requirements ans Goals
we use "peak utilization" to characterize how efficiently an allocator uses the heap. We are given some sequence of n allocate and free requests &...
1
vote
1
answer
74
views
How OS handles stack growth of multiple threads with option "ulimit -s unlimited"?
By default, linux stack size is limited to 8 MB. So in case of multi-threaded environment each thread will get its own 8 MB stack. If any thread wanders off the bottom of a stack into the guard page ...
0
votes
0
answers
34
views
What is purpose of virtual memory in prometheus?
I am using prometheus and grafana. In grafana in memory profile panel is show two virtual memory graph can someone explain me what are difference between this two and also explain why we need virtual ...
0
votes
1
answer
54
views
Reading and writing memory, but having trouble writing to a virtual address
I am trying to write a program where I scan a processes memory and can also write to these addresses(just like cheat engine). However I did some research and found out that the memory I was reading is ...
2
votes
1
answer
211
views
How does the Dirty and Access bits affect the TLB?
I get it that if a page has been accessed it'll have the Access bit set, and if has been written to, the Dirty bit will also be set. But it's unclear to me how these bits affect the TLB/TLB caching? ...
2
votes
1
answer
196
views
Calculate the entry point of an ELF file as a physical address (offset from 0)
I am building a RISC-V emulator which basically loads a whole ELF file into memory.
Up to now, I used the pre-compiled test binaries that the risc-v foundation provided which conveniently had an entry ...
0
votes
1
answer
148
views
To access and allocate Virtual Memory
I am required to talk directly with the OS asking it to allocate pages in your Python process virtual memory.
How do i access the virtual memory with the address of 0xB621740000 and reserve the memory?...
0
votes
0
answers
47
views
Number of bits for physical/virtual memory
I have a question that goes like this:
Consider a 18 bit system with a page size of 1 KB, and a memory size of 16 KB (2^14 bytes):
a) Given an address, how many bits of that address are the page ...
2
votes
0
answers
105
views
How to limit physical memory in python3?
I am trying to limit the memory usage of a python script, so it gets killed if it exceeds a threshold.
I tried using resource.setrlimit but the module seems to be limited.
resource.setrlimit(resource....
2
votes
0
answers
90
views
How can a non-recursive function appear twice in a stack trace?
I have a function check that is roughly like this:
void check() {
// ...
// Make some execute-only memory readable for subsequent inspection
// using the mprotect system call
...
1
vote
1
answer
207
views
How does the address translation between Main Memory and Disk storage work?
This question comes up when I learn about virtual memory and memory management.
The following describes what I understand so far:
The memory hierarchy, which benefits from locality principle, briefly ...
0
votes
0
answers
156
views
Minimum number of frames for correct execution of processes
What is the minimum number of frames for correct execution of processes on a processor with instructions of type (and why):
register instruction, memory-operation
register instruction, register
memory-...
0
votes
0
answers
10
views
Is it possible to make a virtual memory relative to a Durable storage device?
Is it possible to implement the virtual memory mechanism for durable storage devices (such as a disk)?
As you know, do it for RAM, but is it conceptually possible to do it for durable storage devices ...
0
votes
1
answer
7
views
Must I keep a virtual address range reservation if it has active mappings?
CUDA's low-level virtual memory management mechanism involves:
Physical allocations
Virtual address range reservations
Mappings between the above
Conveniently, if you map a physical allocation to ...
0
votes
0
answers
43
views
Will mmu be used when cpu access virtual memory allocated via kmalloc?
I'm aware that memory allocated by kmalloc is physically continuous and virtual memory it returned has just an offset from its physical memory.
But if CPU tries to access the virtual memory it ...
0
votes
2
answers
150
views
Why is cuMemAddressReserve() failing with CUDA_INVALID_VALUE?
Consider the following program (written in C syntax):
#include <cuda.h>
#include <stdio.h>
#include <stdlib.h>
int main() {
CUresult result;
unsigned int init_flags = 0;
...
0
votes
0
answers
11
views
Is cuMemAddressReserve specific to a context, or are such reservations global?
With recent CUDA versions, we can perform lower-level virtual memory management - physical allocations, address range reservations and mappings. I'm wondering about how 'global' these manipulations of ...
0
votes
0
answers
14
views
Why does cuMemAddressReserve take an out parameter?
The cuMemAddressReserve() takes an address range (addr, size) the caller wants to reserve. Strangely, it also takes a CUdeviceptr* ptr parameter, where it places... the value of addr, supposedly:
...
0
votes
0
answers
41
views
Dumping virtual memory addresses of an executable
I want to dump the virtual memory addresses of a running executable.
This is the code I'm running: ./executable & cat /proc/$(pidof executable)/maps > maps.dump, and this is the error I get: ...
0
votes
0
answers
53
views
calculate page size using VPO and VPN
consider a virtual memory system that has a 12-bit virtual page offset (VPO), and a 20-bit virtual page number (VPN). what is the page size of this system?
how do I find the page size in general?
0
votes
0
answers
7
views
32-bit (win XP/Vista compatible)application encountering possible fragmentation in virtual memory - fix?
When the application reaches just over 1,500,000 K commit size(in Task Manager), it will crash every single time. I've done some reading and would it be correct to assume it is due to fragmentation? ...
1
vote
1
answer
159
views
How does TLB differentiate between entries of different Page tables?
Since different processes have their own Page table, How does the TLB cache differentiate between two page tables?
Or is the TLB flushed every time a different process gets CPU?
0
votes
0
answers
58
views
Why is the OS responsible of clearing the use bit (reference bit) and dirty bit, but the hardware for setting them?
Why is the OS responsible for clearing the use bit (reference bit) and dirty bit, but the hardware for setting them?
0
votes
0
answers
138
views
Dealing Effective Memort Access Time (EMAT) with page fault
I am confused when dealing a TLB EMAT problem with page fault. Here are the basic settings:
Memory access time = 200ns
TLB access time = 10ns
Page fault service time = 20ms
TLB hit ratio = 95%
Page ...