virtual-memory

If size of the physical memory is 2^32-1, then what is the size of virtual memory?

丶灬走出姿态 提交于 2019-12-10 19:42:12
问题 I know that physical address will be 32 bits long but how do I find out the size of virtual memory by this information? 回答1: The total size of the virtual memory address space is 2^32 on x86 and much larger (currently around 2^48) on x64. However, the OS usually reserves a portion of this space, so a 32bit app can't necessarily address 4gb at once. Also, the OS can easily swap different pieces of memory in and out, so if necessary, more than 4gb could be supported with assistance of the OS

Determine who/what reserved 5.5 GB of virtual memory in w3wp.exe

时光毁灭记忆、已成空白 提交于 2019-12-10 12:57:17
问题 On my machine (XP, 64) the ASP.net worker process (w3wp.exe) always launches with 5.5GB of Virtual Memory reserved. This happens regardless of the web application it's hosting (it can be anything, even an empty web page in aspx). This big old chunk of virtual memory is reserved at the moment the process starts, so this isn't a gradual memory "leak" of some sort. Some snooping around with windbg shows that the memory is question is Private, Reserved and RegionUsageIsVAD, which indicates it

Why the addresses of local variables can be different every time?

痴心易碎 提交于 2019-12-10 12:53:35
问题 I've asked Google and did some research on StackOverflow. My question is that when I enter the main() function in a C++ program and declare the very first variable, why is it that the address of this variable can vary upon different executions? Please see my example program below: #include <iostream> int main() { int *a = new int; int *b = new int; std::cout << "address: " << a << " " << b << std::endl; std::cout << "address of locals: " << &a << " " << &b << std::endl; return 0; } Result on

How do I get the information shown in vmmap programatically?

99封情书 提交于 2019-12-10 11:33:19
问题 As anyone who has watched the Mark Russovich talk "Mysteries of Memory Management Revealed" knows, the vmmap tool can show you things that count against your process limit (2GB on vanilla 32 bit windows) that few other tools seem to know about. I would like to be able to programmatically monitor my real total memory size (the one that's germane to the process limit) so I can at least log what's going on when I approach the process limit. Is there any information publicly available on how

How to reduce virtual memory by optimising my PHP code?

不羁岁月 提交于 2019-12-10 09:43:51
问题 My current code (see below) uses 147MB of virtual memory! My provider has allocated 100MB by default and the process is killed once run, causing an internal error. The code is utilising curl multi and must be able to loop with more than 150 iterations whilst still minimizing the virtual memory. The code below is only set at 150 iterations and still causes the internal server error. At 90 iterations the issue does not occur. How can I adjust my code to lower the resource use / virtual memory?

Virtual memory and alignment - how do they factor together?

江枫思渺然 提交于 2019-12-10 03:14:46
问题 I think I understand memory alignment, but what confuses me is that the address of a pointer on some systems is going to be in virtual memory, right? So most of the checking/ensuring of alignment I have seen seem to just use the pointer address. Is it not possible that the physical memory address will not be aligned? Isn't that problematic for things like SSE? 回答1: The physical address will be aligned because virtual memory only maps aligned pages to physical memory (and the pages are

Virtual Memory and Physical Memory

佐手、 提交于 2019-12-09 06:45:54
问题 I am studying the concept of Memory Management Unit(MMU) from the book titled "Operating System Concepts" - by Abraham Silberschatz and Galvin. Though things were fine till chapter 8. As soon I started with chapter 9, things started messing up. I am not clear about what my virtual memory is? Also, physical and logical addresses seems to be confusing now? Does it(virtual memory) exists in real or not? As per my understanding of now, the RAM of my system is what I call Physical(or main) Memory.

Application to manage its own Virtual Memory

浪子不回头ぞ 提交于 2019-12-08 06:38:16
问题 I have a slight doubt regarding virtual memory. Normally, it is up to the OS to provide virtual memory to using disk space to expand the amount of memory which appears to be available for applications. The OS will clear physical memory by copying the data to disk and restoring when needed. However, it is possible for an application to manage its own “virtual memory” rather than the OS, for example by writing objects to a file then destroying them? If so, is allowing application to manage its

How to map pages using the page fault handler?

泪湿孤枕 提交于 2019-12-08 05:53:50
问题 I want to use the pagefault handler of my struct vm_area_struct * to map a physical page to user space. Here is how I proceed: I globally allocate a page using alloc_page(GFP_USER) during the module initialization (I tried various GFP). I create a struct vm_area_struct , set a custom pagefault handler, and attach the vma to current->mm . When a page fault occurs: I set vmf->page to the page I previously allocated and return 0. The result is that every virtual page in the vma should be mapped

How can I get an OutOfMemoryException in .Net?

穿精又带淫゛_ 提交于 2019-12-08 04:28:19
问题 In a memory hungry app I'm developing I'm facing OutOfMemoryExceptions. I expected to never have this kind of exceptions with virtual memory. Why if it is needed more RAM than available the OS is not using the HD as RAM? 回答1: You can get an OutOfMemoryException in many different ways. In 32-bit windows, a process can use 2GB of virtual address space (I believe it's 1TB in 64-bit applications). Keep in mind this is not RAM, it is completely different, hence "virtual". So forget about RAM. All