Port leak? "prl_disp_service" consumes Mach ports with no VMs running

Discussion in 'General Questions' started by GuyL, Sep 6, 2009.

  1. GuyL

    GuyL Bit Poster

    I noticed recently in the Mac OSX Activity monitor that process "prl_disp_service" had the highest port count of any running process. The Mac had been up for several days. I have since rebooted the Mac and watched the prl_disp_service port count increase, even though I did not start up the Parallels Desktop application.

    prl_disp_service is allocating about twenty extra Mach ports every hour.

    Could this behavior lead eventually to a Parallels failure (if a port allocation request fails) or -- even worse -- a Mac OSX hang (due to exhausted ports)?
  2. GuyL

    GuyL Bit Poster

    Setup details:
    The host computer is running MacOSX 10.4.11.
    The Parallels Desktop version is 4.0.3846.

    Another leak:
    When I start the Parallels Desktop application, the "prl_disp_service" port count goes up by five.
    When I quit the application (without starting any virtual machines), the port count goes down by only three, leaving a net increase of two ports.
  3. Anupama A

    Anupama A

    Hello GuyL,

    In regards to the issue please copy paste the command given below in the terminal (Finder -> Application -> Utilities -> Terminal) and press return on the keyboard. Then you will be asked to enter the administrator password. You have to type in the password and hit return. Then you need to restart the mac.

    sudo /Library/Parallels/Parallels\ Service.app/Contents/MacOS/prl_disp_service -e --logfile /var/log/prl_disp_service_server.log --pidfile /var/run/prl_disp_service.pid &

    After restarting the mac please launch Parallels Desktop again.

    Let me know if it worked or not.
  4. GuyL

    GuyL Bit Poster

    Greetings, Anupama.

    I ran the "sudo ... prl_disp_service -e --logfile /var/log/prl_disp_service_server.log --pidfile /var/run/prl_disp_service.pid" command that you suggested and rebooted the Mac.

    The port leak continues, in both varieties:
    (1) Without the Parallels Desktop application running, the "prl_disp_service" still uses about 20 extra Mach ports per hour.
    (2) When I start the application, the port count increases by 5; when I quit, the count decreases by 3.

    Here is a list of times and process information:

    Time Process id, name #Prts
    {reboot; login}
    08:52 188 prl_disp_service 126
    {start application; quit application}
    08:54 188 prl_disp_service 128
    09:05 188 prl_disp_service 132
    10:19 188 prl_disp_service 162

    From 08:54 to 10:19 (85 minutes), 34 extra ports were in use: roughly 24 per hour. (Maybe I miscalculated in the earlier post?)

    I would like to stress that Parallels Desktop is working for me; I am just worried that the port leak in the background will eventually cause some kind of problem if the Mac stays up for weeks at a time.
  5. Anupama A

    Anupama A

    Hello GuyL,

    Please follow these steps in regards to the issue:

    Restart MAC, don't start any applications. Uninstall Parallels Desktop using the .dmg file.
    Now, please follow these steps :

    1. Open Finder.
    2. Go to Applications/Utilities/Disk Utilities.
    3. Choose MAC HD.
    4. Choose repair disk permissions.
    After running the repair disk permissions , restart the computer. Install Parallels Desktop.


    I hope this will help in resolving the issue.
  6. GuyL

    GuyL Bit Poster

    Before I do the "un-install / repair permissions / re-install" cycle, I have more data to submit.

    I used Apple's old "MachPortDump" utility to produce plain-text reports of prl_disp_service's Mach port usage at two different times, then used "diff" to see the changes. It looks like the extra ports are being used for a single "send" right, then discarded/forgotten.

    Here is the command I used for generating each time-stamped dump report:
    sudo ~gcl/Public/MachPortDump -w prl_disp_service > ~/prl_ports.$(date +%Y%m%d-%H%M).txt

    I have attached two dump files whose "diff" output shows 44 extra ports.

    The diff command:
    diff prl_ports.20090910-0712.txt prl_ports.20090910-0858.txt

    This problem feels analogous to this pseudocode:

    void check_status(void)
    int port_descriptor;

    port_descriptor = allocate_a_mach_port(...);

    /* Bug: forgot to do "deallocate(port_descriptor)" ! */


    If this is the case, uninstall/repair/reinstall won't help, since prl_disp_service will still execute the same allocate + no deallocate logic.

    I will do the uninstall/repair/reinstall if the Parallels support staff really think that the procedure will resolve the leak.

    Attached Files:

  7. beta_vanjab


    Are there any updates regarding the Mach port leak issue? We are experiencing the issue with our critical virtual server. It is consuming Mach ports until the system comes to a halt, with gradual performance decrease in between.
    What type of information do I have to provide to try to get this resolved? We are trying not to switch to VMWare, so I hope this issue can be resolved in a timely manner.
  8. JulieH


    Looks like prl_disp_service is checking each VM every second

    Using fs_usage, here's what I see happening every second, even though Parallels isn't running:
    09:36:11.139 select S=0 0.999540 W prl_disp_service
    09:36:11.139 stat /Users/user/Documents/Parallels/winxp.pvm/config.pvs 0.000007 prl_disp_service
    09:36:11.139 getattrlist /Users/user/Documents/Parallels/winxp.pvm/config.pvs 0.000006 prl_disp_service
    09:36:11.139 getattrlist /Users/user/Documents/Parallels/winxp.pvm/config.pvs 0.000011 prl_disp_service
    09:36:11.139 getattrlist /Users/user/Documents/Parallels/winxp.pvm/config.pvs 0.000007 prl_disp_service
    09:36:11.139 getattrlist /Users/user/Documents/Parallels/winxp.pvm/config.pvs 0.000009 prl_disp_service
  9. JulieH


    Possible workaround

    When you're done with Parallels:
    sudo killall -STOP prl_disp_service

    When you want to start using it again
    sudo killall -CONT prl_disp_service

Share This Page