CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004
    Posts
    4

    Question How to set virtual memory to be zero

    In windows 2000 or Windows XP, I need an API function to set virtual memory to be zero, in other words, I want not use paging file.
    Help me.

  2. #2
    Join Date
    Sep 2002
    Posts
    924
    I am not sure if there is an API function to change the Windows virtual memory settings, but you should be able to simply modify the appropriate registry key to do what you want.

    Key:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management

    Value:
    PagingFiles

    The data type is REG_MULTI_SZ and the format is:
    <location> <initial size> <maximum size>
    i.e. "C:\pagefile.sys 1344 2048"

    Setting the data for the above value to an empty string would result in setting Windows to not use a paging file. Of course a reboot would be required after modifying the registry key value, just as it would be if you changed the settings through System Properties, etc.

  3. #3
    Join Date
    Feb 2004
    Posts
    4
    Thanks, Dear RussG1 .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured