Click here to Skip to main content
15,742,619 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
My problem is that over time the memory usage (especially the virtual memory) increases until the system freezes. There is hardly not traffic on the server and it seems to happen independendly from making any HTTP-Request.

Last time the virtual memory of the "/usr/sbin/apache2 -k start" process has used over 8GB virtual memory. It was several days from the last apache2 restart.

I have a virtual Machine with 1GB RAM and 15GB HDD where I have Ubuntu 22.04 installed with Apache/2.4.52 over apt with mod_wsgi, a python virtual environment where Django 4.0.5 is installed via pip.

I do not run Django in daemon mode but in the "default" mode.

I changed nothing in apache2.conf.

My site-configuration looks like this:

WSGIPythonHome /var/www/venv
WSGIPythonPath /var/www/venv/fye_backend

<VirtualHost *:80>
    ServerAdmin (my email)

    WSGIScriptAlias / /var/www/venv/fye_backend/fye/

    ErrorLog /var/www/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

I serve the files like this code (in

def example(request):

    key = request.GET.get("key")
    some_info = some_model.objects.get(key)
    return HttpResponse(some_info)

What could be the reason for this problem? If more information is needed please let me know. Thanks!

What I have tried:

Beginning totally from scratch. It has helped something, because before the System freezed allready after a day. But the problem still persists.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900