Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4098190
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T20:16:12+00:00 2026-05-20T20:16:12+00:00

I have some huge binary files which I’m currently reading using memory mapping on

  • 0

I have some huge binary files which I’m currently reading using memory mapping on Windows. Everything works fine, but problems start when the file size is larger than memory. For instance, on a 24 GiB memory machine, I map a 64 GiB file and then I’m doing more or less streaming reads through it (not totally streaming, but ok’ish.) Nevertheless, the process winds up using all memory at some point.

I’m touching each byte in the file exactly once, so it should be enough to keep let’s say 4-5 GiB around for optimal performance. Is there a way to force Windows (7) to discard pages? FlushViewOfFile discards dirty pages only, but in my use case, I’m only reading from the file. I’ve already set the NO_BUFFER flag, but I’d like to be able to reduce the page priority somehow so they get evicted more quickly. Right now, once the memory is full, the app comes to a grinding halt as Windows pages out everything.

[Edit] It’s a 64-bit application on a 64-bit windows.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T20:16:12+00:00Added an answer on May 20, 2026 at 8:16 pm

    Don’t map it all as a single view. Call CreateFileMapping once, then call MapViewOfFile and UnmapViewOfFile as you need segments of the file. UnmapViewOfFile should cause the pages to be discarded.

    You can of course have several views from the same file mapping at once, they can be overlapping or non-overlapping, and overlapping views will be coherent (even across different file mappings and different processes).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to give a general note to some huge Java project for which
I have some huge binary driver logs (around 2-5GB each, and probably around 10x
Using Windows So I'm reading from a binary file a list of unsigned int
I'm using Java+struts2+JSP as the web application framework. I have to pass some huge
I have a huge database with some 100 tables and some 250 stored procedures.
I have some ASP.NET web services which all share a common helper class they
I have some C# / asp.net code I inherited which has a textbox which
I've looked at binary reading and writing objects in c++ but are having some
I have a 16mb binary file and I want to read bytes without using
I have a map defined like this std::map<some_key_type, std::string::iterator> mIteratorMap; And a huge string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.