Recent

Author Topic: Too many open files  (Read 419 times)

apeoperaio

  • Full Member
  • ***
  • Posts: 206
Too many open files
« on: January 22, 2021, 02:35:35 pm »
When I try to open few thousands of files I get the error:
'Too many open files'

I get this error on Mac but not on Windows. I am using lazarus fixes and lazarus trunk branches.

I attached a sample project (it uses dropfiles on a form since I cannot load all the files using opendialog, see: https://forum.lazarus.freepascal.org/index.php/topic,52989.0.html) and a python script to create the files.

Is it a limit of macos? How can I check the value of this constraint?

Thank you.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 6906
  • Debugger - SynEdit - and more
    • wiki
Re: Too many open files
« Reply #1 on: January 22, 2021, 02:43:41 pm »
It is (probably) an OS limit.
Run:
Code: Bash  [Select][+][-]
  1. ulimit -a

440bx

  • Hero Member
  • *****
  • Posts: 2174
Re: Too many open files
« Reply #2 on: January 22, 2021, 02:52:49 pm »
<snip> open few thousands of files I get the error:
Just curious, what are you doing that requires having several thousand files open at the same time ?
FPC v3.0.4 and Lazarus 1.8.2 on Windows 7 64bit.

winni

  • Hero Member
  • *****
  • Posts: 2206
Re: Too many open files
« Reply #3 on: January 22, 2021, 02:54:49 pm »
Hi!

Whaatver strange things you do with thousands of open files ....

To change the soft and hard limit of open files on Mac & Linux have a look at:

https://wilsonmar.github.io/maximum-limits/

Winni

apeoperaio

  • Full Member
  • ***
  • Posts: 206
Re: Too many open files
« Reply #4 on: January 27, 2021, 10:32:14 am »
Thank you for your tips.

 

TinyPortal © 2005-2018