Ag-Grid table causes memory leak

Hi All! I’ve been using an app with Ag-Grid component and noticed that it was taking up too much server space. After doing some investigation, it seems that using the Ag-Grid component causes a memory leak.
In short, my app loads some data from csv/excel file to pandas dataframe and then uses Ag-Grid table with checkboxes to dynamically select rows.

Here’s the code snippet:

import streamlit as st
import pandas as pd
from st_aggrid import AgGrid
from st_aggrid.grid_options_builder import GridOptionsBuilder
from st_aggrid import GridUpdateMode, DataReturnMode

def load_data():
    my_file = 'data_source.xlsx'
    df = pd.read_excel(my_file)
    return df

data = load_data()

gb = GridOptionsBuilder.from_dataframe(data)
gb.configure_default_column(enablePivot=False, enableValue=False, enableRowGroup=False)
gb.configure_selection(selection_mode="multiple", use_checkbox=True)
gridOptions =

response = AgGrid(

response_df = pd.DataFrame(response["selected_rows"])

I used memory profiler and it is apparent that the app does not release the memory when using AgGrid (images attached). I went through the AgGrid documentation, but didn’t find anything on this topic. Am I missing something? Does anyone encounter such issue?

Many thanks!


Note: The problem was solved after updating Python version & reinstalling libraries