An application I am working on (Mostly swift 4.2 with sprinklings of C and C++) appears to be leaking mach ports when run on Mojave and currently has 3,600 open after running for 12 hours. I am just looking at the 'Ports' field in Activity Monitor to see this.
The same binary running on Sierra is using about 500 ports.
The application is quite complex, making extensive use of DispatchQueue() and also has an associated privileged helper.
Unfortunately, I have been unable to create a simple test case that demonstrates the behaviour.
I have done a lot of searching to find out what may be causing the problem and come up with zilch. Is there any debugging tool (i.e. Instruments plugin maybe) that might help to narrow down where the allocation/leakage is coming from. I have seen the results of the tests on google Chrome from a few years back but I'm not keen to start building, installing and debugging kernel extensions to track this problem down.