Comments (1)
So there are two different "large" memory leaks, depending on whether we are writing or reading. Large in this case means that memory is leaked for every event. Additionally, there are a few "small" leaks, where we leak only once for the whole execution. (There are also a few other leaks from within the depths of ROOT, but those or not really our concern, I suppose).
The small ones:
m_table
inEventStore
(see #134 for a fix)- temporary
l_table
inROOTReader::openFiles
(see #135 for a fix)
The large ones:
- When reading we leak all the metadata pointers that are newly allocated by the readers, because, even though the EventStore doesn't really take ownership of the data provided by the reader, but instead copies the data into its members. E.g. here:
Lines 89 to 97 in d4a0265
Moving the data into the internal member and deleting the temporary pointer, fixes this (also fixed in #134) - When writing the situtation is a bit more complex. Memory is leaked when we create objects with VectorMembers (potentially others too, but definitely with these) outside of collections and then add them to collections via
push_back
, e.g. in the form of
ExampleWithVectorMemberCollection coll;
auto vec = ExampleWithVectorMember();
coll.push_back(vec)
The problem is that as soon as we push the vec
to the collection, it becomes tracked by the collection, and the deconstructor will only delete the internal vector in ExampleWithVectorMemberObj
that is allocated via new
if it is not tracked. The collection should in principle do this, but does not do it at the moment. Assuming that the object can become invalid as soon as the collection is clear
ed, then the fix is simply to make the collection properly clean up all its related memory (this is also implemented in #134).
from podio.
Related Issues (20)
- Removal of deprecated EventStore and related components
- Mutability conversion fails on `push_back` to collection via Python bindings HOT 2
- Improve python interface when adding collections to a frame HOT 1
- In PODIO 00-16-05, `ROOTLegacyReader` can't read files written by 00-16-02 HOT 1
- `PODIO_JSON_OUTPUT` not set downstream, but json support still compiled into libraries HOT 5
- Misleading Error: Invalid Member Definition HOT 10
- Generated `id` method for user facing types has become useless
- Codify state machines of readers and writers
- Cleanup double `void*` in CollectionBuffers
- Better out-of-bounds checks for collection access
- Better import structure for python bindings
- Subset collections of datatypes with VectorMembers do not work HOT 1
- Generate ROOT dictionary of vector<XXXData> classes HOT 5
- The clang12 nightlies no longer exist
- Make podio a (pip installable) python package
- PODIO_JSON_OUTPUT causes nlohmann/json.hpp in each include file, could be json_fwd.hpp instead HOT 1
- Podio collections are missing `empty()`, iterators missing `operator==()`
- Check podio Collections for C++ Container compatibility
- Frame based I/O crashes when reading objects with related object that were not persisted
- New python import structure does not work if SIO backend is not built HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from podio.