xsdata icon indicating copy to clipboard operation
xsdata copied to clipboard

Please feed your bugs! :bug:

Open HiImJulien opened this issue 2 years ago • 2 comments

I am trying use the generator for this schema.

After noticing that the generator needs some time, I decided to take a break. Returning from the break I noticed the generator is still running. Or should I say eating? At this point the generator already ate 50.1GB of my RAM. The RAM usage keeps going up.

Is this intended or did I find a pretty hungry :bug:? Is there something I am perhaps doing wrong?

My environment is:

  • Windows 10 x64
  • Python 3.10.7
  • xsdata 22.8 (latest from pip)

EDIT My command line analogous to what is show in the readme:

xsdata ./xcb-proto/src/xcb.xsd --package generator.schema

HiImJulien avatar Sep 14 '22 22:09 HiImJulien

Intresting case @HiImJulien self referencing group, I am on it

  <xsd:group name="expression">
    <xsd:choice>
      <xsd:element name="op">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:group ref="expression" />

tefra avatar Sep 15 '22 06:09 tefra

Oh I remembered, I have come accross something similar. Since nested (inner) classes are referring back to the parent class it creates this infinite loop during processing.

I added back then the option to promote all inner classes to root --unnest-classes, give it a try

xsdata https://raw.githubusercontent.com/freedesktop/xcb-proto/master/src/xcb.xsd --unnest-classes
Parsing schema https://raw.githubusercontent.com/freedesktop/xcb-proto/master/src/xcb.xsd
Compiling schema https://raw.githubusercontent.com/freedesktop/xcb-proto/master/src/xcb.xsd
Builder: 23 main and 18 inner classes
Analyzer input: 23 main and 18 inner classes
Analyzer output: 34 main and 0 inner classes
Generating package: init
Generating package: generated.xcb

I am afraid there is no other way around this, but I am going to add a check to raise an appropriate error with instructions how to resolve it.

tefra avatar Sep 15 '22 06:09 tefra

I think we can close this one, let me know if it didn't work for you @HiImJulien

tefra avatar Sep 28 '22 08:09 tefra