tiqi-group / pydase

A flexible and robust Python library for creating, managing, and interacting with data services, with built-in support for web and RPC servers, and customizable features for diverse use cases.
MIT License
0 stars 1 forks source link

Fix memory leak in ObservableObject #126

Closed mastadle closed 1 month ago

mastadle commented 1 month ago

Pydase currently has a significant memory leak if a DataService contains a dict or a list.

Changed

Minimal Example

import json
import time

import pydase

dict_json = """
{
    "foo": "bar"
}
"""

class Service(pydase.DataService):
    def __init__(self) -> None:
        super().__init__()
        self.dict_attr = {}

service = Service()

while True:
    service.dict_attr = json.loads(dict_json)
    time.sleep(0.01)
mosmuell commented 1 month ago

Thanks for debugging this!