forked from ppy/osu
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmono.env
More file actions
45 lines (45 loc) · 2.65 KB
/
Copy pathmono.env
File metadata and controls
45 lines (45 loc) · 2.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# AndroidEnvironment file — Mono runtime environment variables baked into
# the APK and exported before Mono initialises. See the .NET for Android
# documentation on environment files (build action `AndroidEnvironment`).
#
# These are required by osu.Android/Native/crash_handler.cpp to be able to
# symbolicate JIT frames in native_crash.log. Without them, the perfmap
# either is never written (no --jitmap) or is written to a path the app
# cannot read back (default /tmp).
#
# MONO_ENV_OPTIONS=--jitmap
# Tells Mono to write one line per JIT-compiled managed method to
# <TMPDIR>/perf-<pid>.map in the format "<hex_addr> <hex_size> <name>".
# crash_handler.cpp's resolveViaPerfmap() reads this file when symbolicating
# crash backtraces. Has negligible runtime overhead (a single fprintf per
# JIT compile, which already happens infrequently after warm-up).
#
# TMPDIR=/data/user/0/sh.ppy.osulazer/cache
# Redirects Mono's temp-file output (and, transitively, anything that goes
# through .NET's Path.GetTempPath()) into the app's *internal* cache dir.
#
# IMPORTANT: this MUST point at internal storage, not at the external
# /storage/emulated/... path. External storage on modern Android is a
# FUSE/sdcardfs mount, and the Linux kernel disallows mkfifo() on FUSE
# mounts (returns EACCES/13). RealmAccess.getConfiguration() sets
# FallbackPipePath = Path.GetTempPath() + "/lazer", and Realm calls
# mkfifo() there to create its cross-process notifier (.cv / .note files);
# pointing TMPDIR at external storage causes Realm.GetInstance() to throw
# "Failed to create fifo … Permission denied" on every startup, before the
# managed file logger is up. An internal path (ext4/f2fs-backed) supports
# FIFOs and is also writable by the app without runtime permissions.
#
# Side-effect: perf-<pid>.map is now in internal cache and is not directly
# retrievable by the user on an unrooted device. That's fine — it is only
# consumed by our in-process native crash handler at crash time (which
# reads getenv("TMPDIR") to find it), and the symbolicated output it
# produces is written into native_crash.log in the external files dir,
# which IS user-retrievable.
MONO_ENV_OPTIONS=--jitmap
TMPDIR=/data/user/0/sh.ppy.osulazer/cache
# Increase the Gen0 nursery to 8 MB (default is 4 MB).
# At typical osu! gameplay allocation rates (~4-8 MB/s of transient objects),
# the default nursery fills and triggers a Gen0 collection roughly every 0.5-1 s.
# Doubling the nursery halves that frequency, reducing mid-gameplay GC interruptions.
# Safe on modern Android devices (≥4 GB RAM); the extra 4 MB resident cost is negligible.
MONO_GC_PARAMS=nursery-size=8m