summaryrefslogtreecommitdiffstats
path: root/m_property.c
diff options
context:
space:
mode:
authorder richter <der.richter@gmx.de>2021-05-12 19:43:35 +0200
committerder richter <der.richter@gmx.de>2021-05-16 13:50:40 +0200
commit9fbe000451140f0e6937db61a7bebc57faa4d69b (patch)
treed44c2c70163a4033b2375dbca97c03bbf88ef0f4 /m_property.c
parentf8128f6570cfee1d076811c8c2abb9e82c4834bc (diff)
downloadmpv-9fbe000451140f0e6937db61a7bebc57faa4d69b.tar.bz2
mpv-9fbe000451140f0e6937db61a7bebc57faa4d69b.tar.xz
osxbundle: fix slow and wasteful memory allocation
when using the bundle with activated big enough cache, very slow and wasteful memory allocations lead to jittery playback and lot of dropped frames. the cache had to have a certain size so it would constantly allocate new memory to reproduce this. this never happens when started from the terminal. the source of the problem is a different malloc allocation policy, MALLOC_NANO, that allocated a huge amount of virtual memory without actually using it. the usage was between 0% to 25% of that virtual memory. the binaries allocation policy on the other hand used >80% of that allocated virtual memory and was a lot more efficient, it would use MALLOC_TINY instead. this is fixed by setting the MallocNanoZone environment variable to 0 to use the V1 of the allocation policy. when started from the bundle via launchd this is forced to 1 and V2 policy which causes this problem. some more info can be found in following file and its comments on the Apple open source site: https://opensource.apple.com/source/libmalloc/libmalloc-317.40.8/src/nano_malloc_common.c.auto.html Fixes #7405
Diffstat (limited to 'm_property.c')
0 files changed, 0 insertions, 0 deletions