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

  • SEARCH
  • Home
  • 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 6786269
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:13:31+00:00 2026-05-26T17:13:31+00:00

I have a small test program that creates millions of files (for testing purposes)

  • 0

I have a small test program that creates millions of files (for testing purposes) in thousands of folders. It is C code with fopen and fclose calls.

This code runs fine on Linux (RHEL, SUSE), but on Windows the memory usage increases as the number of files to create increases (near a million files). The system memory usage increases
to nearly 8 GB (system capacity) and the program becomes extremely slow (I assume due to swapping in and out of pages).

At this time the program’s memory requirements remain constant at around few MBs though (which is expected). I observed that the cache usage in the memory increases rapidly as the program progresses and keeps growing through the life of the program. How can I tell Windows not to cache these files or folders and is it even possible?

  • 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-26T17:13:31+00:00Added an answer on May 26, 2026 at 5:13 pm

    Just a guess, but you might just be trashing/filling the file cache with files that do not need to be used again. This would slow down the system, because it must read files from disk. Also the disk would be in use while it was doing this.

    You could try using the Win32 API and CreateFile with the file flag FILE_FLAG_NO_BUFFERING so that is does not cache files.

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

Sidebar

Related Questions

I have a small program I want to execute to test something #include <map>
I have MANY small Test Projects where I put together just enough code to
Work on this small test application to learn threading/locking. I have the following code,
I am writing a small test program that gives the following xml file as
I have written a small test program in which I try to use the
Let say I have written a small program that reads file_A and file_B as
I have a program that opens a large binary file, appends a small amount
Have small web page at www.peterbio.com/mom/test.htm Someone wrote the code with mouse over and
I have a small C++ program that parses a file given as a command
I have an small server/client test program I am running over a radio link

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.