REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 1.54 KB
Close
//proc/thread-self/root/opt/cloudlinux/venv/lib/python3.11/site-packages/lvestats/plugins/generic/lvestats_memory_usage.py
Text
Base64
# coding=utf-8 # # Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2019 All Rights Reserved # # Licensed under CLOUD LINUX LICENSE AGREEMENT # http://cloudlinux.com/docs/LICENSE.TXT import logging import os import psutil from guppy import hpy from lvestats.core.plugin import LveStatsPlugin class LVEStatsMemoryUsage(LveStatsPlugin): def __init__(self): self.log = logging.getLogger('plugin.LVEStatsMemoryUsage') self.now = 0 # This changes in MainLoop self.period = 60 * 60 self.threshold = 512 try: self._process = psutil.Process(os.getpid()) except AttributeError: self._process = None self.log.error("Process attribute in psutil is not available. psutil.__version__=%s", psutil.__version__) self._hpy = hpy() self._hpy.setrelheap() @staticmethod def split(value): return str(value).split("\n") def execute(self, lve_data): if self._process is None: return rss = self._process.memory_info()[0] / float(1024 * 1024) self.log.debug(str(rss)) if rss >= self.threshold: heap = self._hpy.heap()[:10] result = { 'heap': self.split(heap), 'byid': self.split(heap.byid), 'byvia': self.split(heap.byvia), 'byrcs': self.split(heap.byrcs), } self.log.error("LVEStats uses too much memory", extra=result) elif rss < self.threshold / 2: self._hpy.setrelheap()
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 2 × Files: 13
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
burster
DIR
-
drwxr-xr-x
2026-03-05 22:36:53
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
__pycache__
DIR
-
drwxr-xr-x
2026-03-05 22:36:53
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
aggregators.py
5.45 KB
lrw-r--r--
2026-02-17 11:00:05
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
analyzers.py
9.38 KB
lrw-r--r--
2026-02-17 11:00:05
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
cleaners.py
4.09 KB
lrw-r--r--
2026-02-17 11:00:05
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
cm_collector.py
10.58 KB
lrw-r--r--
2026-02-17 11:00:05
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
collectors.py
3.31 KB
lrw-r--r--
2026-02-17 11:00:05
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
dbgov_saver.py
6.74 KB
lrw-r--r--
2026-02-17 11:00:05
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
dbsaver.py
5.65 KB
lrw-r--r--
2026-02-17 11:00:05
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
dbsaver_x60.py
10.03 KB
lrw-r--r--
2026-02-17 11:00:05
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
lvestats_memory_usage.py
1.54 KB
lrw-r--r--
2026-02-17 11:00:05
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
persistors.py
13.51 KB
lrw-r--r--
2026-02-17 11:00:05
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
snapshot_saver.py
16.69 KB
lrw-r--r--
2026-02-17 11:00:05
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
statsnotifier.py
50.28 KB
lrw-r--r--
2026-02-17 11:00:05
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
__init__.py
219 B
lrw-r--r--
2026-02-17 11:00:05
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).