traceback_clear
Clear traceback frames to prevent memory leaks.
def traceback_clear(
exc: Exception = None
) - > null
Clear traceback frames to prevent memory leaks. MEMORY LEAK FIX: This function helps break reference cycles between traceback objects and frame objects that can prevent garbage collection. Clearing frames releases local variables that may be holding large objects.
Parameters
| Name | Type | Description |
|---|---|---|
| exc | Exception = None | The exception object containing the traceback to be cleared; if not provided, the function retrieves the current exception information from sys.exc_info(). |
Returns
| Type | Description |
|---|---|
null | Nothing is returned; the function performs in-place clearing of traceback frame data. |