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 8930827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:58:53+00:00 2026-06-15T08:58:53+00:00

I faced with the problem there was exception OSError 24 (Too many open files)

  • 0

I faced with the problem there was exception OSError 24 (“Too many open files”) raised on my mac os x in python script.

I had no idea what could caused that issue. lsof -p showed about 40-50 lines, and my ulimit was 1200 (I check that using

resource.getrlimit(resource.RLIMIT_NOFILE)

), that returned tuple (1200, 1200). So I didn’t exceed limit even closely.

That my script spawned number of subprocesses and also allocated shared memory segments. Exception occurred while allocating shared memory segments. I use sysv_ipc module.

Also I knew I total allowed number of shared memory segments is enough large (128 segments), and command

ipcs -b -m

gave definitely less number (not more then 40 segments).

  • 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-06-15T08:58:54+00:00Added an answer on June 15, 2026 at 8:58 am

    The issue was in shared memory system settings (shared memory – wiki).

    There is parameter kern.sysv.shmseg in /etc/sysctl.conf file which represents the maximum number of shared memory segments each process can attach. So I had value 32 that was not enough for my script.

    To view parameters, use:

    sysctl -A | grep shm
    

    To update that parameters, edit file:

    sudo vim /etc/sysctl.conf
    

    My looks now like that:

    kern.sysv.shmmax=564777216
    kern.sysv.shmmin=1
    kern.sysv.shmmni=700
    kern.sysv.shmseg=128
    kern.sysv.shmall=131072
    

    Notice, you need restart system in order to apply settings.

    To view currently allocated shared memory segments, type:

    ipcs -m -b
    

    To remove all shared memory segments:

    for n in `ipcs -b -m | egrep ^m | awk '{ print $2; }'`; do ipcrm -m $n; done
    

    Notice, only segments that are not attached to any process will be really removed.

    More on shared memory settings: http://techjournal.318.com/general-technology/shared-memory-settings-explain/, http://www.spy-hill.com/help/apple/SharedMemory.html, http://support.apple.com/kb/HT4022

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

Sidebar

Related Questions

I faced the problem debugging my WPF-WCF simple chat application. There's an exception like:
I've faced a bit strange problem. There is a site client would like to
This is raised because of the technical difficulties faced in my Project. Problem: I
I faced this problem many times during various situations. It is generic to all
I have faced this problem several times that whenever we serve files from Blobstore
I faced a problem while using threading for the first time, In an SWT
I faced a problem - I need to use a macro value both as
I faced a problem regarding loading ResourceBundle at server-side on Seam 2.2 application. In
I faced a problem that I can not find a way to change the
I have faced a problem in Qt with error: cannot convert parameter 1 from

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.