jbake-org / jbake-gradle-plugin

A Gradle plugin for JBake
Other
45 stars 21 forks source link

Memory leak (?) with Gradle's continuous build #31

Closed ajoberstar closed 4 years ago

ajoberstar commented 7 years ago

I'm using the ./gradlew bake -t (continuous build) to automatically refresh my site changes as I'm editing. After a while I get messages like Expiring Daemon because JVM Tenured space is exhausted. This causes the build to slow significantly until I end the continuous build with CTRL+D. Gradle won't expire the daemon while the continuous build is running, so you have to end it yourself.

I'm assuming this means something is leaking (at least in the context of a continuous build). FIxing this might involve both resolving the leak, but I think also using the (new) Worker API to fork the JBake baking to it's own process so that it doesn't destabilize the daemon.

I'm currently seeing this with Gradle 3.5.1 and JBake plugin 1.0.0.

I'm not sure exactly when, but I would be willing to make a PR for this. I just want to confirm whether this seems like an issue to you and to work out the approach you'd like taken.

gliptak commented 6 years ago

@ajoberstar What do you use to serve the (build) directory while running continuous build? Thanks

ajoberstar commented 6 years ago

@gliptak It's been a while, but I think I just used a file:// URI in the browser, so no special server.

gliptak commented 6 years ago

@ajoberstar Just using the file://, links, CSS, etc. don't resolve right. But thank you for your response regardless.

ancho commented 6 years ago

What kind of template engine are you using? I noticed a memory problem with thymeleaf template engine and prepare a pr for that.

ancho commented 6 years ago

See https://github.com/jbake-org/jbake/pull/471

ajoberstar commented 6 years ago

@ancho I think it was Jade, but not positive which of my projects I saw this in, so can't recall.

ancho commented 6 years ago

Ok. Thank you. Is it still happening? Gradle is at version 4.9. They did a lot of work with build cache optimization and things like that. This plugins latest version is 1.2.0.