mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-10-05 14:55:08 +00:00
EXP: log trims (do not merge)
This commit is contained in:
@@ -117,6 +117,12 @@ class MallocTrimmer:
|
||||
logger.debug("malloc_trim failed; not trying again", exc_info=True)
|
||||
self._libc = None
|
||||
return False
|
||||
logger.debug("malloc_trim(0) took %.1f ms, released=%s",
|
||||
(self._clock() - now) * 1000.0, released)
|
||||
def _rss():
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user