mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-10-05 23:05:10 +00:00
EXP: log trims (do not merge)
This commit is contained in:
@@ -18,7 +18,7 @@ if project_dir not in sys.path:
|
|||||||
# stay): the in-process twin of the unit's MALLOC_ARENA_MAX=2, for units
|
# stay): the in-process twin of the unit's MALLOC_ARENA_MAX=2, for units
|
||||||
# installed before that line. A no-op off glibc. See src/malloc_tuning.py.
|
# installed before that line. A no-op off glibc. See src/malloc_tuning.py.
|
||||||
from src import malloc_tuning
|
from src import malloc_tuning
|
||||||
malloc_tuning.cap_arenas()
|
print('EXP cap_arenas=%s' % malloc_tuning.cap_arenas(), flush=True)
|
||||||
|
|
||||||
# Under systemd the watchdog clock is already running, and start-up (plugin
|
# Under systemd the watchdog clock is already running, and start-up (plugin
|
||||||
# loads, initial updates) takes far longer than the render loop's limit. Widen
|
# loads, initial updates) takes far longer than the render loop's limit. Widen
|
||||||
|
|||||||
@@ -117,6 +117,12 @@ class MallocTrimmer:
|
|||||||
logger.debug("malloc_trim failed; not trying again", exc_info=True)
|
logger.debug("malloc_trim failed; not trying again", exc_info=True)
|
||||||
self._libc = None
|
self._libc = None
|
||||||
return False
|
return False
|
||||||
logger.debug("malloc_trim(0) took %.1f ms, released=%s",
|
def _rss():
|
||||||
(self._clock() - now) * 1000.0, released)
|
try:
|
||||||
|
with open('/proc/self/statm') as f:
|
||||||
|
return int(f.read().split()[1]) * 4096 // 1024
|
||||||
|
except Exception:
|
||||||
|
return -1
|
||||||
|
logger.info("EXP malloc_trim(0) took %.1f ms, released=%s rss_kb_after=%d",
|
||||||
|
(self._clock() - now) * 1000.0, released, _rss())
|
||||||
return released
|
return released
|
||||||
|
|||||||
Reference in New Issue
Block a user