Back Midas Rome Roody Rootana
  Midas DAQ System  Not logged in ELOG logo
Entry  08 Dec 2025, Konstantin Olchanski, Bug Report, odbxx memory leak with JSON ODB dump 
    Reply  09 Dec 2025, Stefan Ritt, Bug Report, odbxx memory leak with JSON ODB dump 
       Reply  09 Dec 2025, Konstantin Olchanski, Bug Report, odbxx memory leak with JSON ODB dump 
Message ID: 3179     Entry time: 09 Dec 2025     In reply to: 3176
Author: Konstantin Olchanski 
Topic: Bug Report 
Subject: odbxx memory leak with JSON ODB dump 
> Thanks for reporting this. It was caused by a
> 
>   MJsonNode* node = MJsonNode::Parse(str.c_str());
> 
> not followed by a 
> 
>   delete node;
> 
> I added that now in odb::odb_from_json_string(). Can you try again?
> 
> Stefan

Close, but no cigar, node you delete is not the node you got from Parse(), see "node = subnode;".

If I delete the node returned by Parse(), I confirm the memory leak is gone.

BTW, it looks like we are parsing the whole JSON ODB dump (200k+) on every odbxx access. Can you parse it just once?

K.O.
ELOG V3.1.4-2e1708b5