View Single Post
Old 07-24-2007   #4 (permalink)
Setting virtual memory progrmmatically


 
 

Re: Setting virtual memory progrmmatically

Hi

Thanks for your reply.
I want to just reserve it. I have replaced MEM_COMMIT by MEM_RESERVE. It is
now working fine.

Our application uses M5drvr32.exe to play .dir files. It works in Xp without
any problem.
In Windows Vista it pops up an error "This program requires at least 3MB of
free virtual memory to run."
Since we don't have control over M5drvr32.exe, I thought of changing the
virtual memory programmatically.
Is there any other way to resolve it without changing the virtual memory?

Best Regards
Sudesh



"Andrew McLaren" wrote:

> "Setting virtual memory progrmmatically" <Setting virtual memory
> progrmmatically@discussions.microsoft.com> wrote ...
> > I have used VirtualAllocEx().
> > It works only when "Automatically manage paging file size for all
> > drives" (This option is not there in Windows Xp) is selected in System
> > Preference/Performance Options. It doesn't work when "Custom size" is
> > selected in System Preference/
> > Performance Options(works fine in Windows Xp).

>
> Namaste Sudesh,
>
> When you say "it doesn't work" ... what does GetLastError() report?
>
> And just to be clear - are you really to Commit that memory? Or do you want
> to just Reserve it?
>
> The main reason your Commit would fail, would be if there is no backing
> store available for the Virtual Memory pages. A popular form of backing
> store is the paging file. It's quite possible that on your system, more of
> the paging file is being utilised under Vista than it was under XP;
> therefore there is no backing store available to commit the memory pages. It
> isn't necessarily an error. "Virtual Memory" as seen by a process, and the
> paging file on the disk, are two separate and independent concepts, although
> closely related. User mode applications typically have no control over the
> size of the paging file - in fact, any application which tried to set the
> size of the paging file programmatically, would be a very bad design - IMHO.
> But not sure that's what you're trying to do ...
>
> Cheers
>
> --
> Andrew McLaren
> amclar (at) optusnet dot com dot au
>
>

My System SpecsSystem Spec