Use Page File

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • cfps.Christian

    #1

    Use Page File

    Is there a way to tell a process to specifically use the page file for
    object storage?

    Our problem is we are loading objects that need to be stored during
    application runtime but not actually saved until told to do so. In
    our case these objects can easily eat 300+ MB of memory.
    Unfortunately we can't save any of the images until the overall
    project is saved so we don't have the luxury of the local drive for
    temp storage.
  • Ignacio Machin ( .NET/ C# MVP )

    #2
    Re: Use Page File

    On Jul 28, 4:20 pm, "cfps.Christian " <ge0193...@otc. eduwrote:
    Is there a way to tell a process to specifically use the page file for
    object storage?
    >
    Our problem is we are loading objects that need to be stored during
    application runtime but not actually saved until told to do so.  In
    our case these objects can easily eat 300+ MB of memory.
    Unfortunately we can't save any of the images until the overall
    project is saved so we don't have the luxury of the local drive for
    temp storage.
    Hi,

    I suggest you to find another apporach, what about loading partially
    the objecT?
    What kind of objets are you talking about?

    Comment

    • Peter Duniho

      #3
      Re: Use Page File

      On Mon, 28 Jul 2008 13:20:06 -0700, cfps.Christian <ge0193387@otc. edu>
      wrote:
      Is there a way to tell a process to specifically use the page file for
      object storage?
      I assume here you are using "page file" to be synonymous with "swap file".
      Our problem is we are loading objects that need to be stored during
      application runtime but not actually saved until told to do so. In
      our case these objects can easily eat 300+ MB of memory.
      Unfortunately we can't save any of the images until the overall
      project is saved so we don't have the luxury of the local drive for
      temp storage.
      Why not?

      But as far as your specific question goes, if you store the data in
      memory, it will be backed by the page file as needed. You don't need to
      do anything special to have that happen.

      Conversely, you cannot have something backed by the page file unless you
      have made room for it in your virtual address space. Even if there were
      some mechanism by which you could tell Windows "_really_ put this in the
      page file", you would still be limited by the same constraints associated
      with memory allocations generally.

      If you have data that is too large to fit in your process's address space,
      the file system is where you're going to have to put it. If you aren't
      able to do that for some reason (and why not?), then I think you're stuck
      needing a solution that allows you to deal with only a portion of the data
      at a time (just as Ignacio suggests).

      Pete

      Comment

      • cfps.Christian

        #4
        Re: Use Page File

        I suggest you to find another apporach, what about loading partially
        the objecT?
        What kind of objets are you talking about?
        Images

        The application loads a TON of images and it requires thumbnails the
        majority of the time. These are dynamically generated images so we
        don't have an image on the drive to pull from. I'd been told years
        ago that you can write specifically to the PageFile but that may only
        be in C++ or a lower level language.

        I was hoping that my lack of need for speed would mean that I could
        put them all in the pagefile or put a flag somehow to tell the OS that
        the memory should go to page or whatever.

        Unfortunately another moment where imagination is limited by language
        constraints.

        Comment

        • =?ISO-8859-1?Q?Arne_Vajh=F8j?=

          #5
          Re: Use Page File

          cfps.Christian wrote:
          Is there a way to tell a process to specifically use the page file for
          object storage?
          >
          Our problem is we are loading objects that need to be stored during
          application runtime but not actually saved until told to do so. In
          our case these objects can easily eat 300+ MB of memory.
          Unfortunately we can't save any of the images until the overall
          project is saved so we don't have the luxury of the local drive for
          temp storage.
          All .NET objects gets allocated in virtual memory. Some of them will
          reside in physical RAM - some of them (hopefully not too many !) will
          reside in the page file.

          AFAIK there are no way that you can specify that some objects
          should reside in page file and not in RAM.

          (there are way to specify that objects should reside in RAM
          and not in page file even though I don't think you can do that
          for managed memory)

          If you need to have it in a file, then write and read the objects
          explicit to and from a file in a binary direct access way that is
          reasonable efficient.

          But I don't think it is worth coding that. The paging mechanism is
          pretty sophisticated, so if you do not access your 300 MB of
          objects *and* the system need the RAM, then they will end up in
          the page file. If you need access to the objects then you don't
          want them on disk. And if there are available RAM, then you can just
          as well use it.

          Arne

          Comment

          • =?UTF-8?B?QXJuZSBWYWpow7hq?=

            #6
            Re: Use Page File

            Peter Duniho wrote:
            On Mon, 28 Jul 2008 13:20:06 -0700, cfps.Christian <ge0193387@otc. edu>
            wrote:
            >Is there a way to tell a process to specifically use the page file for
            >object storage?
            >
            I assume here you are using "page file" to be synonymous with "swap file".
            Rather unlikely.

            Page file is the term used on Windows (NT family - not 9x family).

            Swap file is the term used on *nix.

            Arne

            Comment

            Working...