diff --git a/src/py/flwr/client/clientapp/app.py b/src/py/flwr/client/clientapp/app.py index cef822a14e86..e3291f08d4f9 100644 --- a/src/py/flwr/client/clientapp/app.py +++ b/src/py/flwr/client/clientapp/app.py @@ -16,6 +16,7 @@ import argparse +import gc import time from logging import DEBUG, ERROR, INFO from typing import Optional @@ -160,6 +161,9 @@ def run_clientapp( # pylint: disable=R0914 stub=stub, token=token, message=reply_message, context=context ) + del client_app, message, context, run, fab, reply_message + gc.collect() + # Reset token to `None` to prevent flwr-clientapp from trying to pull the # same inputs again token = None