Bug 274718 - Huge Save File using new code generator
Summary: Huge Save File using new code generator
Status: REPORTED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-02 02:17 UTC by Kip
Modified: 2021-03-09 14:51 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Bloated Umbrello UML project file (250.22 KB, application/octet-stream)
2011-06-02 02:17 UTC, Kip
Details
Hack bash script to remove junk from XMI file. (2.31 KB, text/plain)
2014-07-25 21:15 UTC, Kip
Details
signature.asc (197 bytes, application/pgp-signature)
2014-07-25 23:53 UTC, Kip
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kip 2011-06-02 02:17:28 UTC
Created attachment 60548 [details]
Bloated Umbrello UML project file

Version:           unspecified (using Devel) 
OS:                Linux

My Umbrello UML project file (.xmi) is huge at 3.4 MB. It really shouldn't be. No idea why. I've attached it gzip compressed (only 250 KB). I'm guessing there is a bunch of junk Umbrello is putting in the file that doesn't need to be. I am using Umbrello svn head (r1234623).

Reproducible: Sometimes

Steps to Reproduce:
Download attached project file and open it.
Comment 1 G. Gibson 2011-07-01 05:20:39 UTC
I can confirm this bug.  I have the same results with identical setup.
Comment 2 Oliver Kellogg 2011-07-01 17:13:47 UTC
As a workaround, have you looked at
http://sourceforge.net/mailarchive/message.php?msg_id=25627567
?
Comment 3 Kip 2011-07-02 22:47:31 UTC
Hey Oliver, yes, I've seen and tried that. That managed remove the bulk of it. I don't know how that binary junk got in there, but thankfully it's gone.

I seem to have identified another problem massively contributing to bloated save files. A friend of mine sent me a project file that I already had, but he had made some minor changes, saved, and then emailed the project file to me. I noticed his was only 1 MB, whereas mine was 3.4 MB. When I opened his and resaved it, it then bloated to 7.4 MB. It stayed at 7.4 MB if I kept resaving.

I took a look at a diff between his project and mine, since we hadn't really changed much, and I saw the following...

The end of his project file contained:
  (...)
  </listview>
  <codegeneration>
   <codegenerator language="C++"/>
  </codegeneration>
 </XMI.extensions>
</XMI>

In mine on the other hand, sandwiched between the codegeneration tags is 47007 lines of code generator elements...

(...)
  </listview>
  <codegeneration>
   <codegenerator language="C++">
(...)
    <classifiercodedocument package="Logical View" fileExt=".h" parent_class="jodyPkDFUDsT" id="cppheaderjodyPkDFUDsT" fileName="const_char_" writeOutCode="true">
     <textblocks/>
     <header>
      <codecomment tag=""/>
     </header>
     <classfields/>
    </classifiercodedocument>
   </codegenerator>
  </codegeneration>
 </XMI.extensions>
</XMI>

Either he and I have different Umbrello configuration settings or Umbrello has a bug where it's inserting the code generator output. If the former, where do I disable this?
Comment 4 Andi Fischer 2011-07-04 19:42:12 UTC
I guess that the different sizes of the xmi-files is because of the different set checkbox "Use new C++/Java/Ruby generators" in the general settings dialog.
If the checkbox is selected, code documents are written to the xmi-file.
Comment 5 Kip 2011-07-04 21:28:33 UTC
Hey Andi. I can confirm that you seem to have found the culprit. A couple observations:

(1) The new code generator does not appear to scale well for a large project, like the one I showed you.

(2) If it needs to generate what it did when the feature is enabled, then perhaps we should consider automatic transparent gzip'ing of project files.
Comment 6 Kip 2011-07-05 04:06:51 UTC
Something else I noticed with that project file when trying to export diagram images from the console was the file appears to still have a great deal of garbage in it:

$ umbrello --export svg Engine.xmi
umbrello(644)/kdeui (kdelibs): Attempt to use QAction "edit_undo" with KXMLGUIFactory! 
umbrello(644)/kdeui (kdelibs): Attempt to use QAction "edit_redo" with KXMLGUIFactory! 
umbrello(644) KXMLGUI::ActionList::plug: Index  18  is not within range (0 -  11 
umbrello(644): Guess is Uml::ModelType::N_MODELTYPES - package not set correctly for  ""  / base type  116 
...
< repeats a gazillion times >
...
umbrello(644): Guess is Uml::ModelType::N_MODELTYPES - package not set correctly for  ""  / base type  116 
umbrello(644): loadFromXMI(UMLRole): id  "eGBqqwbL28pg"  is already in use!!! Please fix your XMI file. 
...
< repeats a gazillion times with different id >
...
umbrello(644): loadFromXMI(UMLRole): id  "8rcMzyH06JU6"  is already in use!!! Please fix your XMI file. 
umbrello(644) UMLListView::findView: returning 0 at UMLListView::findView 
...
< repeats a gazillion times >
...
umbrello(644) UMLListView::findView: returning 0 at UMLListView::findView 
umbrello(644)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
umbrello(644) UMLListView::findView: returning 0 at UMLListView::findView 
umbrello(644) UMLListView::findView: returning 0 at UMLListView::findView 
umbrello(644) UMLListView::findView: returning 0 at UMLListView::findView 
umbrello(644) UMLListView::findView: returning 0 at UMLListView::findView 
umbrello(644) UMLListView::findView: returning 0 at UMLListView::findView 
umbrello(644) UMLListView::findView: returning 0 at UMLListView::findView 
umbrello(644) UMLListView::findView: returning 0 at UMLListView::findView 
umbrello(644) UMLCanvasObject::removeAssociationEnd: can not find given assoc in list 
< repeats a gazillion times >
umbrello(644) UMLCanvasObject::removeAssociationEnd: can not find given assoc in list
Comment 7 Sebastian 2014-07-25 21:10:45 UTC
I need help - I made project in Umbrello , few diagrams, and some classes ... XMI file that has been generated by Umbrello has now 1.1 GB! Umbrello crash when is trying to save it, and opening of this file last forever. Is there any way to compress (compact, clean) XMI file ? 

My Umbrello version is 2.11.5.
Comment 8 Kip 2014-07-25 21:14:59 UTC
Hey Sebastian. Sorry to hear that. Oliver has a link in comment #2 to a script (assuming that was it) that removed the junk out of the XMI file. I see the link is dead, but I have the script saved still and I've uploaded here for you as an attachment. Hopefully this works for you.
Comment 9 Kip 2014-07-25 21:15:39 UTC
Created attachment 87949 [details]
Hack bash script to remove junk from XMI file.
Comment 10 Sebastian 2014-07-25 21:36:01 UTC
Oh man!! THX! :) My XMI is alive again.
Comment 11 Kip 2014-07-25 23:53:12 UTC
Created attachment 87956 [details]
signature.asc

On Fri, 2014-07-25 at 21:36 +0000, Sebastian wrote:
> Oh man!! THX! :) My XMI is alive again.

Right on Sebastian! Glad to hear.
Comment 12 Justin Zobel 2021-03-09 07:00:28 UTC
Thank you for the bug report.

As this report hasn't seen any changes in 5 years or more, we ask if you can please confirm that the issue still persists.

If this bug is no longer persisting or relevant please change the status to resolved.
Comment 13 Kip 2021-03-09 14:51:26 UTC
(In reply to Justin Zobel from comment #12)
> Thank you for the bug report.
> 
> As this report hasn't seen any changes in 5 years or more, we ask if you can
> please confirm that the issue still persists.
> 
> If this bug is no longer persisting or relevant please change the status to
> resolved.

Hey Justin. I actually haven't used Umbrello in years, so unfortunately I'm not in a position to verify.