dpgaspar commented on code in PR #35061:
URL: https://github.com/apache/superset/pull/35061#discussion_r2331116150


##########
superset/initialization/__init__.py:
##########
@@ -638,6 +638,17 @@ def apply_http_headers(response: Response) -> Response:
                     response.headers[k] = v
             return response
 
+        @self.superset_app.after_request
+        def cleanup_analytics_memory(response: Response) -> Response:
+            """Force garbage collection after each request if feature flag 
enabled"""
+            if feature_flag_manager.is_feature_enabled(
+                "FORCE_GARBAGE_COLLECTION_AFTER_EVERY_REQUEST"
+            ):
+                import gc
+
+                gc.collect()

Review Comment:
   This is a bit scary but expected also



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to