Re: Non contiguous Virtual Memory

From: pawan (pawan_at_discussions.microsoft.com)
Date: 12/02/04


Date: Thu, 2 Dec 2004 04:57:02 -0800


> There is no need to attach or detach from the shared memory.
> You will just slide the view over the same section.

Ivan, how can I do so, suppose in my process I got a view of 512 MB (as per
your suggestion) and now this process wants to access the other part of the
shared section which is beyond the 512 MB, what I have to do for this. I can
only think of unmapping the view and again mapping the view to that part of
the shared section. Or is there any other way of doing this (I am new to
Windows shared memory concept so excuse me if I am asking any silly question
:) )?

TIA,
pawan.

"Ivan Brugiolo [MSFT]" wrote:

> If you can get a view of, let's say, 512Megs in each process,
> then, in at most 8 Map-View operation, you can map 4 Gig of a shared
> section.
> Given the fact that most of the operation on the shared memory will be
> local,
> I would not expect that the move-the-mapping operation to be such a
> performanve killer.
> There is no need to attach or detach from the shared memory.
> You will just slide the view over the same section.
> Dlls are loaded at their preferred address, that can be changed with the
> rebase.exe tool.
> However, certain system dlls, (ntdll.dll) must be loaded at the same address
> in each and every process, so, even rebasing will not help much.
>
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
> Use of any included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
>
>
> "pawan" <pawan@discussions.microsoft.com> wrote in message
> news:B578935D-FEB5-4D5B-9F18-CD59EBBE17C5@microsoft.com...
> > Actually a number of process's are going to attach to this memory and
> share
> > the information (do some modifications or just access the data). The
> > Question is how the process which wants to attach to this memory will come
> to
> > know which part of the section to map in its memory? As tracking the
> > information of every bit data is very tedious job. And also it will
> impact
> > the performance as each time the process wants some information exists in
> > shared memory it need to attach, get the information and again detach from
> > the shared memory.
> > I also tried with the /3GB switch, but it did not help me , as some of the
> > ssytem dll's are getting loaded just under the 2GB boundry. Even though
> the
> > 2GB to 3GB virtual memory is free, Still it can not satisfy my request
> (1.5
> > GB).
> > If there is a way by which I can hint the system dlls about the free 2GB
> to
> > 3GB memory range so that those dll's can get loaded in that part of memory
> ..
> > I can get the free virtual space which I am looking for.
> >
> > "Ivan Brugiolo [MSFT]" wrote:
> >
> > > Why cannot you create a section backed by the paging file
> > > and map small views of the section in your address space ?
> > >
> > > --
> > > This posting is provided "AS IS" with no warranties, and confers no
> rights.
> > > Use of any included script samples are subject to the terms specified at
> > > http://www.microsoft.com/info/cpyright.htm
> > >
> > >
> > > "pawan1604" <pawan1604@discussions.microsoft.com> wrote in message
> > > news:DF276ED7-69EF-430F-9063-0F68C97F806E@microsoft.com...
> > > > Hi,
> > > > I am working on a project. where I want to create the file Mapping of
> 1.5
> > > > GB. But due to badly fragmented process virtual memory (many system
> dll's
> > > and
> > > > third party dll's are getting loaded at random address in the process
> > > virtual
> > > > memory), I am not able to do so, as in Windows shared memory can only
> be
> > > > created contiguously (if i am not wrong).
> > > > Can any body help me, how I can create a 1.5 GB file mapping in this
> case?
> > > >
> > > > thanks,
> > > > pawan.
> > >
> > >
> > >
>
>
>



Relevant Pages

  • Re: Non contiguous Virtual Memory
    ... >> There is no need to attach or detach from the shared memory. ... >> rights. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Is shmdt() necessary?
    ... When using shared memory, one process usually attaches to the shared ... memory by calling shmat, and will detach from it before it exits, by ... attach number if one process ends without calling shmdt. ... Some people find it more elegant to explicitly detach everything they ...
    (comp.os.linux.development.system)
  • Multiple links to shared memory segments
    ... got a few objects that each need to attach to the same shared memory ... shared memory segment to to the memory architecture. ... I'd like to stay away from creating global pointers for the obvious ...
    (comp.sys.hp.hpux)
  • Re: Multiple links to shared memory segments
    ... |got a few objects that each need to attach to the same shared memory ... I'm using the POSIX shm_openand mmap() functions. ... |shared memory segment to to the memory architecture. ...
    (comp.sys.hp.hpux)
  • Does Windows 2003 change the security strategy of shared memory?
    ... So we could attach the shared memory using the shmid(the same as UNIX). ... it's OK to attach the shared memory the service created. ... But under Windows 2003, it's not possiable to attach the shared memory even using "administrator". ...
    (microsoft.public.windows.server.general)