go-xml icon indicating copy to clipboard operation
go-xml copied to clipboard

Processing complex XSDs exhausts available memory

Open dpf11 opened this issue 5 years ago • 1 comments

I'm trying to use xsdgen on the SAML 2.0 XSD definitions. Specifically, saml-schema-assertion-2.0.xsd as found at:

https://docs.oasis-open.org/security/saml/v2.0/

I went through and manually downloaded the dependencies and ran:

xsdgen saml-schema-assertion-2.0.xsd xmldsig-core-schema.xsd xenc-schema.xsd

The result is that the process's memory starts ballooning until I had to kill it. On my system that was around 32GB of memory. When I ran it with the -vv flag it appears to be going in circles processing the files over and over. I don't know enough about the tool to say if it's stuck in a loop or some sort of NP-complete hell.

Go version: go version go1.13.6 linux/amd64

dpf11 avatar Jan 30 '20 01:01 dpf11

This is probably a duplicate of #86 . Most likely one of those schema contain a recursive type definition, and xsdgen chokes on that.

droyo avatar Mar 21 '20 01:03 droyo