Remove memory trackign

This commit is contained in:
Leo Vasanko 2023-11-21 14:20:05 +00:00
parent 56bc9b7cc8
commit f7e968666e

View File

@ -2,7 +2,6 @@ import asyncio
import datetime import datetime
import mimetypes import mimetypes
import threading import threading
import tracemalloc
from concurrent.futures import ThreadPoolExecutor from concurrent.futures import ThreadPoolExecutor
from pathlib import Path, PurePath, PurePosixPath from pathlib import Path, PurePath, PurePosixPath
from stat import S_IFDIR, S_IFREG from stat import S_IFDIR, S_IFREG
@ -10,7 +9,6 @@ from urllib.parse import unquote
from wsgiref.handlers import format_date_time from wsgiref.handlers import format_date_time
import brotli import brotli
import objgraph
import sanic.helpers import sanic.helpers
from blake3 import blake3 from blake3 import blake3
from sanic import Blueprint, Sanic, empty, raw, redirect from sanic import Blueprint, Sanic, empty, raw, redirect
@ -34,7 +32,6 @@ app.exception(Exception)(handle_sanic_exception)
@app.before_server_start @app.before_server_start
async def main_start(app, loop): async def main_start(app, loop):
tracemalloc.start()
config.load_config() config.load_config()
app.ctx.threadexec = ThreadPoolExecutor( app.ctx.threadexec = ThreadPoolExecutor(
max_workers=3, thread_name_prefix="cista-ioworker" max_workers=3, thread_name_prefix="cista-ioworker"
@ -42,17 +39,6 @@ async def main_start(app, loop):
await watching.start(app, loop) await watching.start(app, loop)
@app.add_task
async def mem_task():
while True:
await asyncio.sleep(10)
snapshot = tracemalloc.take_snapshot()
top_stats = snapshot.statistics("lineno")
for stat in top_stats[:10]:
print(stat)
objgraph.show_growth(limit=10)
@app.after_server_stop @app.after_server_stop
async def main_stop(app, loop): async def main_stop(app, loop):
quit.set() quit.set()