mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-12 13:26:53 -04:00
insert explicit 'System.gc()' call
This commit is contained in:
parent
134f96be08
commit
1ad8beb49e
@ -106,6 +106,9 @@ public class HMCLGameRepository extends DefaultGameRepository {
|
||||
} catch (IOException ex) {
|
||||
Logging.LOG.log(Level.WARNING, "Unable to create launcher_profiles.json, Forge/LiteLoader installer will not work.", ex);
|
||||
}
|
||||
|
||||
// https://github.com/huanghongxun/HMCL/issues/938
|
||||
System.gc();
|
||||
}
|
||||
|
||||
public void changeDirectory(File newDirectory) {
|
||||
|
@ -225,6 +225,9 @@ public final class VersionsPage extends BorderPane implements WizardPage, Refres
|
||||
root.setContent(failedPane, ContainerAnimations.FADE.getAnimationProducer());
|
||||
});
|
||||
}
|
||||
|
||||
// https://github.com/huanghongxun/HMCL/issues/938
|
||||
System.gc();
|
||||
}).executor().start();
|
||||
}
|
||||
|
||||
|
@ -81,7 +81,12 @@ public class DatapackListPage extends ListPageBase<DatapackListPageSkin.Datapack
|
||||
public void refresh() {
|
||||
setLoading(true);
|
||||
Task.runAsync(datapack::loadFromDir)
|
||||
.withRunAsync(Schedulers.javafx(), () -> setLoading(false))
|
||||
.withRunAsync(Schedulers.javafx(), () -> {
|
||||
setLoading(false);
|
||||
|
||||
// https://github.com/huanghongxun/HMCL/issues/938
|
||||
System.gc();
|
||||
})
|
||||
.start();
|
||||
}
|
||||
|
||||
|
@ -102,6 +102,9 @@ public final class ModListPage extends ListPageBase<ModListPageSkin.ModInfoObjec
|
||||
itemsProperty().setAll(list.stream().map(ModListPageSkin.ModInfoObject::new).sorted().collect(Collectors.toList()));
|
||||
else
|
||||
getProperties().remove(ModListPage.class);
|
||||
|
||||
// https://github.com/huanghongxun/HMCL/issues/938
|
||||
System.gc();
|
||||
}, Platform::runLater);
|
||||
}
|
||||
|
||||
|
@ -100,6 +100,9 @@ public class WorldListPage extends ListPageBase<WorldListItem> implements Versio
|
||||
itemsProperty().setAll(result.stream()
|
||||
.filter(world -> isShowAll() || world.getGameVersion() == null || world.getGameVersion().equals(gameVersion))
|
||||
.map(WorldListItem::new).collect(Collectors.toList()));
|
||||
|
||||
// https://github.com/huanghongxun/HMCL/issues/938
|
||||
System.gc();
|
||||
}, Platform::runLater);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user