Maximum g-code file size?

Post anything you want to discuss with others about the software.

Re: Maximum g-code file size?

Postby cncdrive » Sun Mar 11, 2018 12:32 am

Yes, I have tried that too, I mean to open the file in the editor, then the peak memory usage in the task manager was around 5GB.
It's still strange why it peaked to 10+GB at you, because when the file is opened in the editor, then a single line of operation is done in the UCCNC,
that the RichtextBoxcontrol.Text = gcodestring; , so we simply copy the whole g-code text into the Rich textbox control on the editor Window.
In my opinion that does not justifies GBytes of extra memory usage when the file is only about 150MBytes size and is not even formatted in the Richtextbox and so this operation should not eat up much more memory than the file size.
cncdrive
Site Admin
 
Posts: 2104
Joined: Tue Aug 12, 2014 11:17 pm

Re: Maximum g-code file size?

Postby cncdrive » Sun Mar 11, 2018 12:36 am

And when we search in the text we just use the C# built in search operations which should also not need that much memory.
cncdrive
Site Admin
 
Posts: 2104
Joined: Tue Aug 12, 2014 11:17 pm

Re: Maximum g-code file size?

Postby ger21 » Sun Mar 11, 2018 12:53 am

I just loaded the big file again. I see the opposite of what you see.
While the file is loading, it sits at about 2.8Gb. After the toolpath is displayed, it jumps to 5Gb and stays there.
Opening the file in the editor takes it up to about 6Gb.
I briefly say about 8-9Gb this time.
When closing the editor, the memory usage jumped to 8Gb, and stayed there for about 2 minutes, before eventually dropping back to about 5Gb.

This isn't really an issue for me, as I'll probably never use files this large. And even if I did, I have 32Gb of RAM in my PC, so it's not a problem. :D
Just seems strange that the Windows 10 task manager can be wrong by that much??
Gerry
UCCNC 2017 Screenset - http://www.thecncwoodworker.com/2017.html
ger21
 
Posts: 1032
Joined: Sat Sep 03, 2016 2:17 am

Re: Maximum g-code file size?

Postby cncdrive » Sun Mar 11, 2018 1:11 am

Well, I'm not sure if the task manager is that much wrong or Windows 10 just doing these operations so unoptimally.
That the memory usage stays there for even 2 minutes is not that strange though, because if you have much memory installed in the machine then the garbage collector will not hurry to wipe out the disposed objects and so the text which loaded into the editor and which is deleted from there when you close the editor and so the text in there is then disposed will not be deleted instantly.
How the .net garbage collector works is it first marks the items which it thinks will be no more needed and later it checks them again and if they are still not referenced then they get deleted.
And also there are 3 different generations in the heap for items and so for garbage.
It is not like in unmanaged coding where you have to take care to create and delete everything in time and then they immediately happen and you have full control of how you creating and keeping stuff in memory and how and when they get deleted.
In .net the garbage collector automatically takes care of marking and collecting and deleting garbage using complex algorithms and these tasks often do not happen instantly.
You can also force the garbage collector to do these tasks immediately, but that is adviced not to be done (adviced by Microsoft), because it can freeze the application for some time which is never wanted.
So, the recommended way to handle garbage collection is to just leave it on the garbage collector and let it do it automatically when it thinks it is the most optimal to do these tasks.
cncdrive
Site Admin
 
Posts: 2104
Joined: Tue Aug 12, 2014 11:17 pm

Previous

Return to General discussion about the UCCNC software

Who is online

Users browsing this forum: cncdrive and 3 guests