Results 1 to 2 of 2

Thread: Mac: game launching lsof process which spins CPU at 100% (w/horrible UI lag)

  1. #1
    Scavenger
    Join Date
    Sep 2016
    Posts
    49
    Rep Power
    0

    Mac: game launching lsof process which spins CPU at 100% (w/horrible UI lag)

    I would get why you'd want information about open processes and file descriptors for debugging, but this is a fairly horrible practice and the lag it causes is terrible.

    For whatever reason, running lsof against the 7dtd process on Mac is not a lightweight process:

    lsof -p 34020 0.06s user 31.26s system 96% cpu 32.363 total

    It spins for 30 seconds using 100% of a cpu.

    dtruss shows an inordinate amount of time hammering on one system call:

    34379/0x9e4eef: proc_info(0x2, 0x84E4, 0x8) = 1272 0

    with nearly 10,000 calls:

    proc_info 9527

    I don't know if its bugginess in lsof or bugginess in the kernel that is ultimately at the root of this, but you can't have a game firing off lsof processes constantly.

    This seems to be a very old problem with no known solution:

    https://apple.stackexchange.com/ques...iculously-slow

    Throwing the kitchen sink of command line options against lsof it just gets worse not better:

    lsof -n -b -O -P -N -l -p 34020 0.09s user 64.93s system 97% cpu 1:06.53 total

    And the effect on input lag is "literally unplayable" (framerates don't actually drop, but mouse response largely goes away to something like 1 update per second, and i'm testing on the low graphics preset on a Radeon VII so I've got 150-200+ fps via f8). I suspect the proc_info syscalls are suspending the processing on the 7dtd main thread while lsof is hammering on it, or something to that effect (although cpu use in activity monitor of 7dtd doesn't really go down that much).

    I do have NFS mounted NAS on this machine, but 7dtd is running off of an internal SSD and that's why I tried the -N flag, similarly its spinning at 100% and none of the flags to avoid lookups like -n helped at all. The fact that its just hammering on proc_info() presumably against the 7dtd process itself means none of that is particularly relevant.

    I'd love to know how to just turn it off, but grepping through I can't find lsof mentioned in any script. Idly wondering if this is just some EAC idiocy...

    - - - Updated - - -

    Oh yeah I validated that the PPID of the lsof was the 7dtd process, and the same PID that it was scanning, so it is 7dtd forking off the process:

    UID PID PPID CPU PRI NI VSZ RSS WCHAN STAT TT TIME COMMAND
    501 34565 34020 0 31 0 4762348 33620 - R ?? 0:22.96 lsof -p 34020

    501 34020 1 0 97 0 22458124 6380392 - R ?? 128:08.52 /Users/lamont/Library/Application Support/Steam/steamapps/common/7 Days To Die/7DaysToDie.app/Contents/MacOS/7DaysToDie -force-glcore -logfile /Users/lamont/Library/Application Support/Steam/steamapps/common/7 Days To Die/output_log__2019-09-07__11-54-00.txt

  2. #2
    Refugee
    Join Date
    Dec 2018
    Posts
    14
    Rep Power
    0
    this is nice! Maybe the cause of eternal lagging of game on macOs?
    My i-7 is smoking on lowest res and settings with 100% loading most of time. The good thing it is not throttling so I get like 3,2-3,7 Ghz all the time.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •