-
-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory leak in dwg2dxf #18
Comments
This is not a memory leak. I run the code in debug mode and the line here reports Line 1910 in 16642a7
470484544 ncontrol for a spline in the hatch. Considering this creates a shared pointer to a DRW_Coord object spline's control list would hog like 13 GBs of memory. But the problem obviously is not the memory here nor the file itself (I do not think it is corrupted or anything). The convertor does not have this problem for CADs without hatch type object. The section (L1900 to L 1918 in the file above) that adds the spline must be revisited. Other CAD files from Villa Savoye suffer from the same problem. |
The issue turned out be a parsing error as I suspected. I used the DWG file spec found here to make a comparison with the actual code and there appears to be two mistakes in both this branch and to the mainline code in the SourceForge. Below is the simple patch file created by git diff of the fix. Steps:
Cheers. |
When converting the file
Ceco.NET-Architecture-Tm-271.dwg
obtained from herewith dwg2dxf 1.0.1
it consumes memory at a rate of 1GB every 5 seconds or so and appears to have no limit (I killed it after 40GB)
The text was updated successfully, but these errors were encountered: