Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Physical memory fragmentation

25 views
Skip to first unread message

Dmitriy Vyukov

unread,
Apr 12, 2009, 9:32:11 AM4/12/09
to
Is there any way to programmatically de-fragment physical memory on
latest versions of Windows (Vista, Server 2008)? I need it for
allocation of large pages (MEM_LARGE_PAGES). Instantly after boot I am
able to allocate ~250 2MB large pages (machine has 2GB of physical
memory), but after some time I am able to allocate 0 large pages. As
far as I understand this relates to physical memory fragmentation.

p.s. I am not allowed to install own service to pre-allocate large
pages.

--
Best regards,
Dmitriy V'jukov

Nathan Mates

unread,
Apr 12, 2009, 12:21:19 PM4/12/09
to
In article <71cc459a-dc01-4490...@t11g2000vbc.googlegroups.com>,

Dmitriy Vyukov <dvy...@gmail.com> wrote:
>Is there any way to programmatically de-fragment physical memory on
>latest versions of Windows (Vista, Server 2008)? I need it for
>allocation of large pages (MEM_LARGE_PAGES). Instantly after boot I am
>able to allocate ~250 2MB large pages (machine has 2GB of physical
>memory), but after some time I am able to allocate 0 large pages. As
>far as I understand this relates to physical memory fragmentation.

If you need large chunks of RAM, then you really should be
considering going to a 64-bit OS. Vista and Server 2008 both have
64-bit flavors. You can allocate *MUCH* more memory on them.

Nathan Mates

--
<*> Nathan Mates - personal webpage http://www.visi.com/~nathan/
# Programmer at Pandemic Studios -- http://www.pandemicstudios.com/
# NOT speaking for Pandemic Studios. "Care not what the neighbors
# think. What are the facts, and to how many decimal places?" -R.A. Heinlein

scot...@mvps.org

unread,
Apr 12, 2009, 12:44:11 PM4/12/09
to
On Apr 12, 12:21 pm, nat...@visi.com (Nathan Mates) wrote:

> Dmitriy Vyukov  <dvyu...@gmail.com> wrote:
>
> >Is there any way to programmatically de-fragment physical memory on
> >latest versions of Windows (Vista, Server 2008)? I need it for
> >allocation of large pages (MEM_LARGE_PAGES). Instantly after boot I am
> >able to allocate ~250 2MB large pages (machine has 2GB of physical
> >memory), but after some time I am able to allocate 0 large pages. As
> >far as I understand this relates to physical memory fragmentation.

Have you tried it without the MEM_LARGE_PAGES bit? 2 MB is not very
"large".

Dmitriy Vyukov

unread,
Apr 13, 2009, 1:58:35 AM4/13/09
to
On Apr 12, 8:21 pm, nat...@visi.com (Nathan Mates) wrote:
> In article <71cc459a-dc01-4490-848f-e684f7368...@t11g2000vbc.googlegroups.com>,

> Dmitriy Vyukov  <dvyu...@gmail.com> wrote:
>
> >Is there any way to programmatically de-fragment physical memory on
> >latest versions of Windows (Vista, Server 2008)? I need it for
> >allocation of large pages (MEM_LARGE_PAGES). Instantly after boot I am
> >able to allocate ~250 2MB large pages (machine has 2GB of physical
> >memory), but after some time I am able to allocate 0 large pages. As
> >far as I understand this relates to physical memory fragmentation.
>
>    If you need large chunks of RAM, then you really should be
> considering going to a 64-bit OS. Vista and Server 2008 both have
> 64-bit flavors. You can allocate *MUCH* more memory on them.


64-bit OS has something to do only with process' virtual address
space. It has nothing to do with physical memory.
64-bit Windows has exactly the same problems with large pages as 32-
bit Windows.

Dmitriy Vyukov

unread,
Apr 13, 2009, 2:03:45 AM4/13/09
to


Yes, I tried it w/o the MEM_LARGE_PAGES, and memory is allocated w/o
problems then. 2MB is indeed not very large for process' virtual
space, though as it turns out is *very* large for continuous physical
memory.

0 new messages