Skip to content
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

Swagger codegen runs out of memory #37

Closed
alexhost opened this issue May 12, 2021 · 2 comments
Closed

Swagger codegen runs out of memory #37

alexhost opened this issue May 12, 2021 · 2 comments

Comments

@alexhost
Copy link

Attempting to generate C# code from Swagger spec runs out of memory.

Running with jdk1.8.0_291, max heap size 4gb.

A bit strange as the log suggests this is occurring on an markdown file.

image

@tlxtellef
Copy link
Member

tlxtellef commented May 18, 2021

The error you are encountering is a known issue with Swagger-Codegen.
See for example swagger-codegen#10199 (that I opened regarding this last year)

The only quick solution that exists currently is allocating more memory for generating, this also means that you will need a 64bit computer with more than 4GB of ram to generate the client.

Alternatively one could fork and just disable the example json-pregen code of the generator, as it isn't used for anything important anyways.

@alexhost
Copy link
Author

For future reference, I managed to get the job done with the following, but I needed 24gb of memory. 20gb was not enough.

java -d64 -Xmx24g -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate -i https://tripletex.no/v2/swagger.json -l csharp -o d:\tripletex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants