question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG][JAVA] Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

See original GitHub issue

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • What’s the version of OpenAPI Generator used?
  • Have you search for related issues/PRs?
  • What’s the actual output vs expected output?
Description

Trying to generate a quite large ~1mb Swagger-file. It had some validation issues, and I tried to fix them. Don’t know if those are relevant, since no matter if it’s fixed or not, no dice. Still «Java heap space» issue.

Relevant issue: bjerkio/tripletexjs#14 Reproduce the issue with this repository: https://github.com/bjerkio/tripletexjs/tree/reproduce

openapi-generator version

4.3.1

OpenAPI declaration file content or url

https://raw.githubusercontent.com/bjerkio/tripletexjs/reproduce/swagger-fixed.json

Command line used for generation

make generate or

java -Xmx4G -jar openapi-generator-cli.jar \
	generate \
	-i ./swagger-fixed.json \
	-g typescript-fetch \
	-o ./out -v
Steps to reproduce
> git clone git@github.com:bjerkio/tripletexjs.git
> git checkout reproduce
> make generate
Related issues/PRs
  • OpenAPITools/openapi-generator#2503
  • OpenAPITools/openapi-generator#4398
  • OpenAPITools/openapi-generator#5201.
Suggest a fix

I’m lost.

@bbdouglas @sreeshas @jfiala @lukoyanov @cbornet @jeff9finger @karismann @Zomzog @lwlee2608 @bkabrda

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
agilobcommented, Dec 23, 2020

I will be slowly looking into it step after step, trying to pick low hanging fruits first, one PR is ready #8181 reduces number of open files, closes resources much sooner. Should help, but I didn’t do any professional profiling for it.

1reaction
cobrazcommented, Dec 22, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

Exception in thread "main" java.lang.OutOfMemoryError
You are short of heap space. The default heap space is not enough for your program. You need to increase your heap space...
Read more >
2 solution of java.lang.OutOfMemoryError in Java - Javarevisited
Hello there, We are getting java.lang.OutOfMemoryError OUT OF SWAP SPACE in our JBoss server, exact error is this : Exception in thread "main"...
Read more >
How to Handle the OutOfMemoryError in Java - Rollbar
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at OutOfMemoryErrorExample.main(OutOfMemoryErrorExample.java:8).
Read more >
Java OutOfMemoryError Exceptions: Causes & Fixes [Tutorial]
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at memory.JavaHeapSpace.main(JavaHeapSpace.java:5).
Read more >
BUG? Java heap space error on catching an event
logError ENGINE-16004 Exception while closing command context: Java heap space java.lang.OutOfMemoryError: Java heap space at ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found