-
-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
jooby-run: redo classloader strategy
jooby-run (maven/gradle) run on top of jboss-modules. As today it uses a single classloader that contains the project classpath + any project dependency (jars). Every time a change is done, jooby restarts the application, drop the classloader and creates a new classloader. This works OK but consumes memory due it must load all classes again. Next release will change this by using two classloaders: main: All project classes will be here. jars: All external dependencies will be here. Then on class change, we are doing to drop/re-create the main class loader only. ALL the external classes will remain the same. This changes not only will reduce the memory usage on development but also makes application restart lot faster (of course). fixes #3018
- Loading branch information
Showing
6 changed files
with
122 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
modules/jooby-run/src/main/java/io/jooby/run/JoobyModuleLoader.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* Jooby https://jooby.io | ||
* Apache License Version 2.0 https://jooby.io/LICENSE.txt | ||
* Copyright 2014 Edgar Espina | ||
*/ | ||
package io.jooby.run; | ||
|
||
import org.jboss.modules.Module; | ||
import org.jboss.modules.ModuleFinder; | ||
import org.jboss.modules.ModuleLoader; | ||
|
||
class JoobyModuleLoader extends ModuleLoader { | ||
|
||
JoobyModuleLoader(ModuleFinder finder) { | ||
super(finder); | ||
} | ||
|
||
public void unload(String name, final Module module) { | ||
super.unloadModuleLocal(name, module); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters