The file reader is built with a lot of classes all extending Block, which made it easy to implement the reader, but as a side effect makes every such class keep a reference to the original OCAD files Buffer object.
This makes us hold on to a lot of memory that we no longer need - all information has already been extracted while reading the file and constructing the objects.
Reading should be better separated from the data objects that hold the read data, so that the buffer can be freed once the file has been completely read.
The file reader is built with a lot of classes all extending
Block
, which made it easy to implement the reader, but as a side effect makes every such class keep a reference to the original OCAD filesBuffer
object.This makes us hold on to a lot of memory that we no longer need - all information has already been extracted while reading the file and constructing the objects.
Reading should be better separated from the data objects that hold the read data, so that the buffer can be freed once the file has been completely read.