Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. System Admin
  4. [Solved] Maximum number of opened files?

[Solved] Maximum number of opened files?

Scheduled Pinned Locked Moved System Admin
helpquestion
10 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    henk21cm
    wrote on last edited by
    #1

    There must be a maximum number of simultaneously opened files. I found out -the hard way- by a rather strange error, that after opening 507 files, a next file could no longer be opened. After fixing the bug in my programm: closing a file after having processed the information, the error dispappeared, so 507 is close to 512, therefore i suppose that 512 files is the maximum. That assumption may be wrong. Is it possible to change the maximum number of simultaneously opened files? If so, how? 21 cm: the universal wave length of hydrogen

    modified on Saturday, April 12, 2008 2:39 PM

    Z L 2 Replies Last reply
    0
    • H henk21cm

      There must be a maximum number of simultaneously opened files. I found out -the hard way- by a rather strange error, that after opening 507 files, a next file could no longer be opened. After fixing the bug in my programm: closing a file after having processed the information, the error dispappeared, so 507 is close to 512, therefore i suppose that 512 files is the maximum. That assumption may be wrong. Is it possible to change the maximum number of simultaneously opened files? If so, how? 21 cm: the universal wave length of hydrogen

      modified on Saturday, April 12, 2008 2:39 PM

      Z Offline
      Z Offline
      Zoltan Balazs
      wrote on last edited by
      #2

      As I know of these limits are per process. There is a KB article on this here[^], that may be of value. So your assumptions may be correct. Also there are some obscure registry settings to change the limit on the max handle limit documented here[^].

      Work @ Network integrated solutions | Flickr | A practical use of the MVC pattern

      H 1 Reply Last reply
      0
      • Z Zoltan Balazs

        As I know of these limits are per process. There is a KB article on this here[^], that may be of value. So your assumptions may be correct. Also there are some obscure registry settings to change the limit on the max handle limit documented here[^].

        Work @ Network integrated solutions | Flickr | A practical use of the MVC pattern

        H Offline
        H Offline
        henk21cm
        wrote on last edited by
        #3

        Hi Zoltan, > There is a KB article on this here[^], that may be of value. It reports 500 per process for NT 4. Seems to be the same for XP. > Also there are some obscure registry settings Those report 10000 handles. Weird. When Googling for an answer, [RedHat] Linux reports 1000 simultaneously opened files as maximum. Fortunately 'decently' recoding the previous mess the solved my agony. Thanks, Henk 21 cm: the universal wave length of hydrogen

        Z 1 Reply Last reply
        0
        • H henk21cm

          There must be a maximum number of simultaneously opened files. I found out -the hard way- by a rather strange error, that after opening 507 files, a next file could no longer be opened. After fixing the bug in my programm: closing a file after having processed the information, the error dispappeared, so 507 is close to 512, therefore i suppose that 512 files is the maximum. That assumption may be wrong. Is it possible to change the maximum number of simultaneously opened files? If so, how? 21 cm: the universal wave length of hydrogen

          modified on Saturday, April 12, 2008 2:39 PM

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          You can modify the maximum number of file handles opened simultaneously. I believe the ceiling is 2048 file handles. You can use _getmaxstdio[^] to verify this on your operating system. If you wish to modify this value you can use _setmaxstdio[^] to set the new value. Best Wishes, -David Delaune

          H 1 Reply Last reply
          0
          • H henk21cm

            Hi Zoltan, > There is a KB article on this here[^], that may be of value. It reports 500 per process for NT 4. Seems to be the same for XP. > Also there are some obscure registry settings Those report 10000 handles. Weird. When Googling for an answer, [RedHat] Linux reports 1000 simultaneously opened files as maximum. Fortunately 'decently' recoding the previous mess the solved my agony. Thanks, Henk 21 cm: the universal wave length of hydrogen

            Z Offline
            Z Offline
            Zoltan Balazs
            wrote on last edited by
            #5

            henk21cm wrote:

            Those report 10000 handles

            Yeah but for handles you must count a lot of things like synchronization/event handles, registry key handles, thread handles, ui object handles (pens, brushes, etc) and file handles.

            Work @ Network integrated solutions | Flickr | A practical use of the MVC pattern

            1 Reply Last reply
            0
            • L Lost User

              You can modify the maximum number of file handles opened simultaneously. I believe the ceiling is 2048 file handles. You can use _getmaxstdio[^] to verify this on your operating system. If you wish to modify this value you can use _setmaxstdio[^] to set the new value. Best Wishes, -David Delaune

              H Offline
              H Offline
              henk21cm
              wrote on last edited by
              #6

              G'day David, > You can modify the maximum number of file handles opened simultaneously. The functions _get and _setmnaxstdio are 2005 and 2008 specific. The project was compiled with the old VC 6.0. > I believe the ceiling is 2048 file handles. Correct, when using the number 2049 in VS 2005, it reports an error. Regards, Henk 21 cm: the universal wave length of hydrogen

              L 1 Reply Last reply
              0
              • H henk21cm

                G'day David, > You can modify the maximum number of file handles opened simultaneously. The functions _get and _setmnaxstdio are 2005 and 2008 specific. The project was compiled with the old VC 6.0. > I believe the ceiling is 2048 file handles. Correct, when using the number 2049 in VS 2005, it reports an error. Regards, Henk 21 cm: the universal wave length of hydrogen

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                henk21cm wrote:

                The functions _get and _setmnaxstdio are 2005 and 2008 specific. The project was compiled with the old VC 6.0.

                This is not correct, what gives you this idea? This function is part of the standard C runtime library. Those functions have been around for as long as I can remember. Possibly even MSVC 5.0 I will have to check later. I also still use MSVC 6.0 for some projects... I just checked and it works just fine. The declaration is inside stdio.h on line 340. It exists in the VC6 documentation as well. http://msdn2.microsoft.com/en-us/library/aa298575(VS.60).aspx[^] Best Wishes, -David Delaune

                H 1 Reply Last reply
                0
                • L Lost User

                  henk21cm wrote:

                  The functions _get and _setmnaxstdio are 2005 and 2008 specific. The project was compiled with the old VC 6.0.

                  This is not correct, what gives you this idea? This function is part of the standard C runtime library. Those functions have been around for as long as I can remember. Possibly even MSVC 5.0 I will have to check later. I also still use MSVC 6.0 for some projects... I just checked and it works just fine. The declaration is inside stdio.h on line 340. It exists in the VC6 documentation as well. http://msdn2.microsoft.com/en-us/library/aa298575(VS.60).aspx[^] Best Wishes, -David Delaune

                  H Offline
                  H Offline
                  henk21cm
                  wrote on last edited by
                  #8

                  G'day David,

                  Randor wrote:

                  henk21cm wrote: The functions _get and _setmnaxstdio are 2005 and 2008 specific. The project was compiled with the old VC 6.0. This is not correct, what gives you this idea?

                  1. The link in the previous reply referred to a webpage in which explicitly "VS 2005 and later" was mentioned. 2) When typing _getmaxstdio in the VC 6 help, a messagebox "No topics found" pops up.

                  Randor wrote:

                  This function is part of the standard C runtime library. Those functions have been around for as long as I can remember.

                  And you are absolutely right. I compiled a simple snippet with both (get/set) under VC 6, and it ran flawlesly. Thanks for the additional info. Regards, Henk 21 cm: the universal wave length of hydrogen

                  L 1 Reply Last reply
                  0
                  • H henk21cm

                    G'day David,

                    Randor wrote:

                    henk21cm wrote: The functions _get and _setmnaxstdio are 2005 and 2008 specific. The project was compiled with the old VC 6.0. This is not correct, what gives you this idea?

                    1. The link in the previous reply referred to a webpage in which explicitly "VS 2005 and later" was mentioned. 2) When typing _getmaxstdio in the VC 6 help, a messagebox "No topics found" pops up.

                    Randor wrote:

                    This function is part of the standard C runtime library. Those functions have been around for as long as I can remember.

                    And you are absolutely right. I compiled a simple snippet with both (get/set) under VC 6, and it ran flawlesly. Thanks for the additional info. Regards, Henk 21 cm: the universal wave length of hydrogen

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #9

                    I'm not sure if your old enough to remember this but in the old MS-DOS days this was achieved by editing a file called CONFIG.SYS in which you could add: FILES=255 http://www.easydos.com/files.html[^] Since Win95 and Win98 was built on top of MS-DOS you could still modify the value in those operating systems as well. If I am not mistaken I believe the default value in Win95 was 60 handles which was set by IO.SYS in the root boot directory unless overridden in CONFIG.SYS. Ahhh the dinosaur age... now I'm feeling old. :sigh: Best Wishes, -David Delaune

                    H 1 Reply Last reply
                    0
                    • L Lost User

                      I'm not sure if your old enough to remember this but in the old MS-DOS days this was achieved by editing a file called CONFIG.SYS in which you could add: FILES=255 http://www.easydos.com/files.html[^] Since Win95 and Win98 was built on top of MS-DOS you could still modify the value in those operating systems as well. If I am not mistaken I believe the default value in Win95 was 60 handles which was set by IO.SYS in the root boot directory unless overridden in CONFIG.SYS. Ahhh the dinosaur age... now I'm feeling old. :sigh: Best Wishes, -David Delaune

                      H Offline
                      H Offline
                      henk21cm
                      wrote on last edited by
                      #10

                      Randor wrote:

                      'm not sure if your old enough to remember this but in the old MS-DOS days this was achieved by editing a file called CONFIG.SYS in which you could add: FILES=255

                      Yes, i do remember, i'm that old that i've been working with punched paper tape and punched cards. Devising a diode array to translate EBCDIC into ASCII. When running into this limited amount of files, CONFIG.SYS was the first file to look for. Under XP it is 0 bytes, not too much space to hold any info of particular value.

                      Randor wrote:

                      If I am not mistaken I believe the default value in Win95 was 60 handles which was set by IO.SYS in the root boot directory unless overridden in CONFIG.SYS.

                      Under DOS (3.2) it was usually set to FILES=20. The default of 8. "Those were the days", compiling programs into .COM files of 512 bytes or less. FCBS=4,4 LASTDRIVE=Z David, we are growing old, but not grumpy! Regards, Henk 21 cm: the universal wave length of hydrogen

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups