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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T06:49:45+00:00 2026-05-18T06:49:45+00:00

I am working on a university assignment, based largely around IPC and shared memory.

  • 0

I am working on a university assignment, based largely around IPC and shared memory. The problem is, as a complete noob to C, I’ve been happily testing my app (which uses shmget and shmat obviously) for hours. As you can probably guess, I’ve not been cleaning up after myself, and now I can’t run my app, because (I assume) shmget cant allocate anymore resources.

My question is: how can I get this resource back without restarting OSX, and is there a GUI tool or something I can use to monitor/manage this shared memory I am creating?

  • 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-18T06:49:46+00:00Added an answer on May 18, 2026 at 6:49 am

    Call shmdt (“shared memory detach”) on the shared memory segment in each process that holds a reference to it. Unix shared memory sections are reference counted, so when the last process detaches from them, they can be destroyed with shmctl(id, IPC_RMID, NULL).

    From outside your application, the only option I can think of right now to clear your shared memory segments is:

    for (int id=0; id < INT_MAX; id++)
        shmctl(id, IPC_RMID, NULL);
    

    but this is a horribly inefficient kludge. (I’m also not sure if it works; it doesn’t on Linux, but Linux violates the Unix standard while MacOS X is certified against it.)

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

Sidebar

Related Questions

I am working on a university assignment and I've been wracking my head around
so I've been working on a project on the university lab computers, and I
I'm working on a game for a university assignment and I want to create
I'm working on a university assignment to improve a game engine. The code we've
I have been working for several months on a RoR project with fellows university
In short, I am currently working on a research problem for my university that
I am a university student. I have been working a lot with Android lately
I am working on a university project and i have the following problem i
I'm working on a university assignment. I am trying to write a linked-list sort
I'm working on university scheduling problem and using simple genetic algorithm for this. Actually

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.