From 4d1551c305dc953f0a2eb874f75cd210018e44d4 Mon Sep 17 00:00:00 2001 From: Mark Hindess Date: Fri, 29 Jun 2012 12:33:30 +0100 Subject: [PATCH] Reduce memory usage during gcode output by discarding processed layers. As each layer is processed, it increases in size by a factor of two or three so by the end the layer list gets quite big. So this removes the list entry after it's been processed. --- lib/Slic3r/Print.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Slic3r/Print.pm b/lib/Slic3r/Print.pm index ed5964bc6..4209aa7ae 100644 --- a/lib/Slic3r/Print.pm +++ b/lib/Slic3r/Print.pm @@ -587,6 +587,7 @@ sub write_gcode { for my $obj_copy (@$object_copies) { my ($obj_idx, $copy) = @$obj_copy; my $layer = $self->objects->[$obj_idx]->layers->[$layer_id]; + $self->objects->[$obj_idx]->layers->[$layer_id] = undef; # retract explicitely because changing the shift_[xy] properties below # won't always trigger the automatic retraction