virtual-memory

Java program with 16GB virtual memory and growing: is it a problem?

送分小仙女□ 提交于 2019-12-18 13:35:26
问题 On Mac OSX 5.8 I have a Java program that runs at 100% CPU for a very long time -- several days or more (it's a model checker analyzing a concurrent program, so that's more or less expected). However, its virtual memory size, as shown in OSX's Activity Monitor, becomes enormous after a day or so: right now it's 16GB and growing. Physical memory usage is roughly stable at 1.1GB or so. I would like to know: is the 16GB (and growing) a sign of problems that could be slowing my program? I start

fork() failing with Out of memory error

守給你的承諾、 提交于 2019-12-18 13:19:09
问题 The parent process fails with errno=12(Out of memory) when it tries to fork a child. The parent process runs on Linux 3.0 kernel - SLES 11. At the point of forking the child, the parent process has already used up around 70% of the RAM(180GB/256GB). Is there any workaround for this problem? The application is written in C++, compiled with g++ 4.6.3. 回答1: Maybe virtual memory over commit is prevented in your system. If it is prevented, then the virtual memory can not be bigger than sizeof

Convert logical (virtual) address to physical address

耗尽温柔 提交于 2019-12-18 12:43:25
问题 I have the following page table of process1 : Assuming that the paging system works with 16bit addresses and page size is 4k And I want to convert the logical address 16000 to a physical address . I'm a little bit new in this topic so go easy on me : Partial solution : The address 16000 fits cell number 3 in the page table , so I guess that I need to work with that cell and its stored frame - 2 . How can I find the offset and the physical address now ? Thanks 回答1: In your case process 1

Why doesn't this memory eater really eat memory?

丶灬走出姿态 提交于 2019-12-18 09:55:46
问题 I want to create a program that will simulate an out-of-memory (OOM) situation on a Unix server. I created this super-simple memory eater: #include <stdio.h> #include <stdlib.h> unsigned long long memory_to_eat = 1024 * 50000; size_t eaten_memory = 0; void *memory = NULL; int eat_kilobyte() { memory = realloc(memory, (eaten_memory * 1024) + 1024); if (memory == NULL) { // realloc failed here - we probably can't allocate more memory for whatever reason return 1; } else { eaten_memory++; return

How to get a struct page from any address in the Linux kernel

拟墨画扇 提交于 2019-12-17 21:58:38
问题 I have existing code that takes a list of struct page * and builds a descriptor table to share memory with a device. The upper layer of that code currently expects a buffer allocated with vmalloc or from user space, and uses vmalloc_to_page to obtain the corresponding struct page * . Now the upper layer needs to cope with all kinds of memory, not just memory obtained through vmalloc . This could be a buffer obtained with kmalloc , a pointer inside the stack of a kernel thread, or other cases

Why Virtual Memory Address is the same in different process?

一曲冷凌霜 提交于 2019-12-17 21:28:18
问题 I know the virtual memory separates 2G(for kernel)/2G(for user) in Windows. But why the address of variable isn't stack continually? Likes 0x22ff74,0x22ff78,0x22ff82,0x22ff86 ? Does it mean that Windows use sandbox mechanism in user process? 回答1: That's exactly what virtual memory is. The operating system provides each program with its own private address space. In reality the operating system is in charge of mapping those virtual addresses back to the physical address space without the

Understanding Virtual Address, Virtual Memory and Paging

好久不见. 提交于 2019-12-17 17:24:33
问题 I've been learning these topics and read many articles and books but they all lack some complementary information and confused me even more. So here, I’d like to explain what I know while I am asking my questions. Hopefully, this topic will be useful for many like me. I'd also like to learn validity of my knowledge and corrections if necessary. Virtual Memory Some articles say “Virtual Memory is some space of Hard Disk which emulates Physical Memory so that we can have more memory than we

How does compiler lay out code in memory

Deadly 提交于 2019-12-17 16:35:35
问题 Ok I have a bit of a noob student question. So I'm familiar with the fact that stacks contain subroutine calls, and heaps contain variable length data structures, and global static variables are assigned to permanant memory locations. But how does it all work on a less theoretical level? Does the compiler just assume it's got an entire memory region to itself from address 0 to address infinity? And then just start assigning stuff? And where does it layout the instructions, stack, and heap? At

Linux 3/1 virtual address split

大憨熊 提交于 2019-12-17 16:11:22
问题 I am missing something when it comes to understanding the need for highmem to address more than 1GB of RAM. Could someone point out where I go wrong? Thanks! What I know: 1 GB of a processes' virtual memory (high memory region) is reserved for kernel operations. The user space can use the remaining 3 GB. This is the 3/1 split. The virtual memory features of the VM map the (continuous) virtual memory pages to physical pages (RAM). What I don't know: What operations use the kernel virtual

Which stack does the page fault handler in an operating system run on

做~自己de王妃 提交于 2019-12-14 04:01:34
问题 I asked a similar question a little while ago but I may have not worded it correctly. So if process A is running and it causes a page fault at location 4000 in memory, and that causes a page fault. Execution will be transferred to the kernel. Then which stack will the page fault handler run on? Is this in the virtual address space of the kernel? Or is stack space reserved for all interrupts of this sort? 回答1: Linux doesn't care whether you're running a C or C++ program, really. When the CPU