virtual-memory

Windows 32-bit virtual memory page mapping issue

烈酒焚心 提交于 2019-12-22 01:14:31
问题 I am learning from here about Windows 32-bit virtual memory page mapping, (I am targeting modern Windows versions, like Vista, Win 7, Server 2003/2008 32-bit versions.) http://blogs.msdn.com/ericlippert/archive/2009/06/08/out-of-memory-does-not-refer-to-physical-memory.aspx Two confusions, user space virtual memory space is limited to 2G normally, but physical disk page storage could be much larger than 2G. Since there are more disk pages than virtual memory pages, so in theory more than one

Access denied error when using VirtualQueryEx

删除回忆录丶 提交于 2019-12-21 21:15:10
问题 So, I wrote a program which is able to successfully read memory from most of processes using VirtualQueryEx . However, I've come across a process for which this function fails. It's not a system process, just a game process. Without Debug privileges I couldn't even open the process's handle. With them I am able to get the process's handle but still get access denied for VirtualQueryEx . I'm not sure but maybe the process is private? If that's the case, what should I do to successfully use

How to avoid running out of memory in high memory usage application? C / C++

帅比萌擦擦* 提交于 2019-12-21 07:53:08
问题 I have written a converter that takes openstreetmap xml files and converts them to a binary runtime rendering format that is typically about 10% of the original size. Input file sizes are typically 3gb and larger. The input files are not loaded into memory all at once, but streamed as points and polys are collected, then a bsp is run on them and the file is output. Recently on larger files it runs out of memory and dies (the one in question has 14million points and 1million polygons).

Higher half kernel initialization

走远了吗. 提交于 2019-12-21 05:04:13
问题 When initializing my kernel, I have a few things that need to happen: 1) paging needs to be enabled, 2) the physical memory manager needs to parse the memory map from grub, and 3) assorted startup code needs to access data that needs to stay there for later (e.g. the GDT, IDT, memory management structures). The dependencies between these steps are driving me crazy. With higher-half, the kernel is linked at its virtual address and so the options I've come up with are 1) enable paging in

Higher half kernel initialization

旧时模样 提交于 2019-12-21 05:04:08
问题 When initializing my kernel, I have a few things that need to happen: 1) paging needs to be enabled, 2) the physical memory manager needs to parse the memory map from grub, and 3) assorted startup code needs to access data that needs to stay there for later (e.g. the GDT, IDT, memory management structures). The dependencies between these steps are driving me crazy. With higher-half, the kernel is linked at its virtual address and so the options I've come up with are 1) enable paging in

How can I use a page table to convert a virtual address into a physical one?

喜你入骨 提交于 2019-12-20 09:19:54
问题 Lets say I have a normal page table: Page Table (Page size = 4k) Page #: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Page Frame #: 3 x 1 x 0 x 2 x 5 x 7 4 6 x x x How can I convert an arbitrary logical address like 51996 into a physical memory address? If I take log base 2 (4096), I get 12. I think this is how many bits I'm suppose to use for the offset of my address. I'm just not sure. 51996 / 4096 = 12.69. So does this mean it lay on page#12 with a certain offset? How do I then turn that into the

Algorithms for modern hardware?

拜拜、爱过 提交于 2019-12-20 09:06:17
问题 Once again, I find myself with a set of broken assumptions. The article itself is about a 10x performance gain by modifying a proven-optimal algorithm to account for virtual memory: On a modern multi-issue CPU, running at some gigahertz clock frequency, the worst-case loss is almost 10 million instructions per VM page fault. If you are running with a rotating disk, the number is more like 100 million instructions. What good is an O(log2(n)) algorithm if those operations cause page faults and

Virtually addressed Cache

那年仲夏 提交于 2019-12-20 04:04:08
问题 Relation between cache size and page size How does the associativity and page size constrain the Cache size in virtually addressed cache architecture? Particularly I am looking for an example on the following statement: If C≤(page_size x associativity), the cache index bits come only from page offset (same in Virtual address and Physical address). 回答1: Intel CPUs have used 8-way associative 32kiB L1D with 64B lines for many years, for exactly this reason. Pages are 4k, so the page offset is

virtual memory concepts

前提是你 提交于 2019-12-19 11:40:16
问题 I am confused about some topics regarding virtual memory. So, i am going to pointwise list them and ask questions. While answering i will prefer if you also list some source where i can clear that doubt. I will be talking with reference to a linux elf executable file. I have heard that every process has the address space of 4gb in a 32 bit system. When i checked the objdump of one of my executable relocatable file i saw that it had limits from 00000000 to ffffffff. Also it contained the

NUMA: How to check in which part of RAM a C++ array is allocated?

走远了吗. 提交于 2019-12-18 17:56:15
问题 I have a server with 2 CPU's and 64GB of RAM, 32GB per CPU. I know that each CPU has it's own part of RAM, lets call them RAM1 and RAM2. I would like to make my program know on which RAM (RAM1 or RAM2) it allocates it's data. I tried to check pointers values: // put the thread at i-th CPU, using pthread_setaffinity_np TData *a = new TData[N]; ... cout << "CPU = " << i << " adress = " << a << endl; but the output looks random. I suppose that is because addresses are virtual. Is there any