Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-5663

Private pages accumulate in Windows RAM and page file when journaling

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.0.4
    • Fix Version/s: 2.0.7, 2.1.1
    • Component/s: Performance, Stability
    • Labels:
    • Environment:
      Windows
    • Operating System:
      Windows

      Description

      The remapPrivateView() routine in Windows in version 2.0.x, used when journaling is enabled, uses VirtualProtect() to try to restore CopyOnWrite pages to their original condition. This doesn't accomplish its goal and instead causes private pages to accumulate, consuming page file space. remapPrivateView() needs to unmap and remap the private view to prevent this accumulation.

      This ticket summarizes the visible symptoms and the fix for those symptoms. Making this change reintroduces SERVER-2942 until the unmapping and remapping can be made completely reliable.

        Issue Links

          Activity

          Hide
          tad Tad Marshall added a comment -

          Fixed by commit 6097787b1f3c7f9b4f8dca68f66d474eaa60b1d1 .

          Show
          tad Tad Marshall added a comment - Fixed by commit 6097787b1f3c7f9b4f8dca68f66d474eaa60b1d1 .
          Hide
          auto auto (Inactive) added a comment -

          Author:

          {u'login': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@10gen.com'}

          Message: LockMongoFilesExclusive in remapViewOfFiles on Windows.

          Since remapViewOfFiles isn't atomic on Windows, it must exclusively acquire the
          "mongo files" lock. Otherwise, "touch" operations in other threads might try
          to access memory during the window when it is not mapped.

          See SERVER-5680, SERVER-5663.
          Branch: master
          https://github.com/mongodb/mongo/commit/d8462a26b9089c5e58d1e340dcada83719ea4e47

          Show
          auto auto (Inactive) added a comment - Author: {u'login': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@10gen.com'} Message: LockMongoFilesExclusive in remapViewOfFiles on Windows. Since remapViewOfFiles isn't atomic on Windows, it must exclusively acquire the "mongo files" lock. Otherwise, "touch" operations in other threads might try to access memory during the window when it is not mapped. See SERVER-5680 , SERVER-5663 . Branch: master https://github.com/mongodb/mongo/commit/d8462a26b9089c5e58d1e340dcada83719ea4e47
          Hide
          tad Tad Marshall added a comment -

          Requesting backport ... should have been requested when backport for SERVER-2942 was requested.

          Show
          tad Tad Marshall added a comment - Requesting backport ... should have been requested when backport for SERVER-2942 was requested.
          Hide
          auto auto (Inactive) added a comment -

          Author:

          {u'date': u'2012-06-20T14:47:51-07:00', u'email': u'tad@10gen.com', u'name': u'Tad Marshall'}

          Message: SERVER-5663, SERVER-2942 MapViewOfFileEx backport

          Backport the fixes for Windows memory-mapped files made in
          2.1.x into the 2.0.x branch. Stop using VirtualProtect in
          remapPrivateView, use UnmapViewOfFile and MapViewOfFileEx
          to refresh the private view of the memory-mapped file.
          Place memory-mapped files at a high address in 64-bit to
          get out of the way of allocations made by Windows.
          Branch: v2.0
          https://github.com/mongodb/mongo/commit/881d6229e1ab58695959862a76f3175e142af84e

          Show
          auto auto (Inactive) added a comment - Author: {u'date': u'2012-06-20T14:47:51-07:00', u'email': u'tad@10gen.com', u'name': u'Tad Marshall'} Message: SERVER-5663 , SERVER-2942 MapViewOfFileEx backport Backport the fixes for Windows memory-mapped files made in 2.1.x into the 2.0.x branch. Stop using VirtualProtect in remapPrivateView, use UnmapViewOfFile and MapViewOfFileEx to refresh the private view of the memory-mapped file. Place memory-mapped files at a high address in 64-bit to get out of the way of allocations made by Windows. Branch: v2.0 https://github.com/mongodb/mongo/commit/881d6229e1ab58695959862a76f3175e142af84e
          Hide
          tad Tad Marshall added a comment -

          Backported to 2.0.7.

          Show
          tad Tad Marshall added a comment - Backported to 2.0.7.

            People

            • Assignee:
              tad Tad Marshall
              Reporter:
              tad Tad Marshall
              Participants:
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: