Open dreammaker opened 9 years ago
Conservatively assuming 20 characters per G-code command, 1,000,000 G-code commands would require roughly 72 + (37+207+8 )1000000 bytes = 185000000 bytes = 185 MB for _buffer
and another 185MB for the responses
list (for calculation see https://code.tutsplus.com/tutorials/understand-how-much-memory-your-python-objects-use--cms-25609 ). If it is possible to replace those lists with ring buffers, that would be a nice change.
The following loop that simply moves back and forth will slowly consume more and more memory, presumably until it crashes.
The problem is that the
Printer
class is storing every line ever sent in_buffer
and doesn't clear it out until disconnecting.