Форум программистов
 

Восстановите пароль или Зарегистрируйтесь на форуме, о проблемах и с заказом рекламы пишите сюда - alarforum@yandex.ru, проверяйте папку спам!

Вернуться   Форум программистов > Низкоуровневое программирование > Win Api
Регистрация

Восстановить пароль
Повторная активизация e-mail

Купить рекламу на форуме - 42 тыс руб за месяц

Ответ
 
Опции темы Поиск в этой теме
Старый 15.02.2013, 18:58   #1
calypso
Форумчанин
 
Регистрация: 02.12.2012
Сообщений: 250
По умолчанию Чем отличается регион памяти Mapped от Private

Если я загружу с диска файл через CreateFileMapping + MapViewOfFileEx в нужный мне адрес памяти,я получаю секцию Mapped.
Нужно получить Private, она чем-то отличается от проекции с диска? Аттрибуты одинаковые чтение+запись+выполнение кода
С точки зрения программы,в чем будет различие?
calypso вне форума Ответить с цитированием
Старый 15.02.2013, 21:56   #2
waleri
Старожил
 
Регистрация: 13.07.2012
Сообщений: 6,331
По умолчанию

VMMap categorizes memory into one of several types:
Цитата:

Image
The memory represents an executable file such as a .exe or .dll and has been loaded into a process by the image loader. It does not include images mapped as data files, which would be included in the Mapped File memory type. Image mappings can include shareable memory like code. When data regions, like initialized data, is modified, additional private memory is created in the process. The Details column shows the file's path.


Private
Private memory is memory allocated by VirtualAlloc and not suballocated either by the Heap Manager or the .NET run time. It cannot be shared with other processes, is charged against the system commit limit, and typically contains application data.


Shareable
Shareable memory is memory that can be shared with other processes, is backed by the paging file (if present), is charged against the system commit limit and typically contains data shared between DLLs in different processes or inter-process communication messages. The Windows APIs refer to this type of memory as pagefile-backed sections.


Mapped File
The memory is shareable and represents a file on disk. The Details column shows the file's path. Mapped files typically contain application data.


Heap
Heaps represent private memory managed by the user-mode heap manager and, like the Private memory type, is charged against the system commit limit and contains application data. Application memory allocations using the C runtime malloc library, HeapAlloc and LocalAlloc, use Heap memory.



Managed Heap

Managed heap represents private memory that's allocated and used by the .NET garbage collector and, like the Private memory type, is charged against the system commit limit and contains application data.


Stack
Stacks are private memory used to store function parameters, local function variables and function invocation records for individual threads. Stacks are charged agains the commit limit and typically grow on demand.


System
System memory is private kernel-mode physical memory associated with the process. The vast majority of System memory consists of the process page tables.


Free
Free memory regions are spaces in the process address space that are not allocated.



Note: The VirtualProtect API can change the protections of any page to something different than that implied by the original allocation's memory type. That means that there can potentially be pages of memory private to the process in a shareable memory region, for instance, because the region was created as a pagefile-backed section, but then the application changed the protection on some pages to copy-on-write and modified them. The protection shown for a region isn't necessarily the protection it had since it's creation.
waleri вне форума Ответить с цитированием
Старый 15.02.2013, 23:22   #3
calypso
Форумчанин
 
Регистрация: 02.12.2012
Сообщений: 250
По умолчанию

Да описание я читал в книге Джеффри Рихтера. Получается что на работоспособности программы никак не скажется если я заменю Private RWE на Mapped RWE т.к. и то и другое "contains application data".Суть проблемы то в чем: оригинальная программа формирует выделенную память через VirtualAlloc (это и есть Private RWE) и с помощью сложного алгоритма пишет туда данные.Эти данные нужны для работы с контентом базы данных.Я же пытаюсь эти данные,заранее сохраненные на диск,подгрузить через проецирование файла данных в память

Последний раз редактировалось calypso; 15.02.2013 в 23:27.
calypso вне форума Ответить с цитированием
Ответ


Купить рекламу на форуме - 42 тыс руб за месяц



Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
Чем запрос отличается от поиска Илья Сергеевич Помощь студентам 1 23.01.2010 12:13
Чем отличается IA-64 от IA-32 Ivan_32 Assembler - Ассемблер (FASM, MASM, WASM, NASM, GoASM, Gas, RosAsm, HLA) и не рекомендуем TASM 2 09.06.2009 16:13
Чем отличается кампилятор от интерпретатора prikolist Помощь студентам 1 20.06.2008 12:16
Чем отличается AX от BX? veter_s_morya Assembler - Ассемблер (FASM, MASM, WASM, NASM, GoASM, Gas, RosAsm, HLA) и не рекомендуем TASM 3 05.05.2008 16:50
Чем отличается Free от FreeInstance? andrey4623 Общие вопросы Delphi 5 27.01.2008 10:18