jhipster / jhipster-lite

JHipster Lite ⚡ is a development platform to generate, develop & deploy modern web applications & microservices architecture, step by step - using Hexagonal Architecture :gem:
https://www.jhipster.tech/jhipster-lite/
Apache License 2.0
433 stars 196 forks source link

Bug: OutOfMemory when using Maven and identation size 4 #10129

Closed cwichoski closed 2 weeks ago

cwichoski commented 2 weeks ago

Discussed in https://github.com/jhipster/jhipster-lite/discussions/10111

Originally posted by **cwichoski** June 19, 2024 Hi I build and run jhipster and got OutOfMemory error, then changed to increase memory to 4Gb with follow command: `jhipster-lite$ java -Xmx4096m -Xms4096m -jar target/*.jar` but still getting OutOfMemory when try to generate the code. Here is the partial exception ``` java.lang.OutOfMemoryError: Java heap space at java.base/java.util.Arrays.copyOf(Arrays.java:3595) at java.base/java.lang.StringLatin1.replace(StringLatin1.java:345) at java.base/java.lang.String.replace(String.java:3100) at tech.jhipster.lite.module.infrastructure.secondary.javadependency.maven.MavenCommandHandler.applyIndentation(MavenCommandHandler.java:447) at tech.jhipster.lite.module.infrastructure.secondary.javadependency.maven.MavenCommandHandler.writePom(MavenCommandHandler.java:437) at tech.jhipster.lite.module.infrastructure.secondary.javadependency.maven.MavenCommandHandler.addDependencyTo(MavenCommandHandler.java:279) at tech.jhipster.lite.module.infrastructure.secondary.javadependency.maven.MavenCommandHandler.handle(MavenCommandHandler.java:268) at tech.jhipster.lite.module.infrastructure.secondary.javadependency.FileSystemJavaBuildCommandsHandler.handle(FileSystemJavaBuildCommandsHandler.java:76) at tech.jhipster.lite.module.infrastructure.secondary.javadependency.FileSystemJavaBuildCommandsHandler.lambda$handle$0(FileSystemJavaBuildCommandsHandler.java:51) ``` I'm using: branch main JDK 21.0.3-tem maven 3.9.7 nodejs 18.16.0 Any idea?
cwichoski commented 2 weeks ago

I found a solution and going to provide a pull request

cwichoski commented 2 weeks ago

I pushed a solution here [1] but I'm with difficult to understand what jacoco needs me to test more, as it's my first time using a project with jacoco and with 100% of code coverage needed, anyone have a clue what more I need to test?

[INFO] Analyzed bundle 'jhlite' with 815 classes
[WARNING] Rule violated for class tech.jhipster.lite.module.infrastructure.secondary.javadependency.maven.MavenCommandHandler: lines covered ratio is 0.99, but expected minimum is 1.00

[1] https://github.com/jhipster/jhipster-lite/compare/main...cwichoski:jhipster-lite:bug10129

renanfranca commented 2 weeks ago

anyone have a clue what more I need to test?

@cwichoski : After running ./mvnw clean verify, go to the target/site/jacoco folder and open the index.html file, which shows the coverage for every package. Navigate to your class and see what is missing to test.

pascalgrimaud commented 1 week ago

I'm adding a bounty on this important ticket as @murdos and @cwichoski worked a lot on this, you can share the bounty plz