Cap save queue
This commit is contained in:
@@ -50,6 +50,18 @@ public class SectionSavingService {
|
|||||||
if (!section.inSaveQueue.getAndSet(true)) {
|
if (!section.inSaveQueue.getAndSet(true)) {
|
||||||
//Acquire the section for use
|
//Acquire the section for use
|
||||||
section.acquire();
|
section.acquire();
|
||||||
|
|
||||||
|
//Hard limit the save count to prevent OOM
|
||||||
|
if (this.getTaskCount() > 5_000) {
|
||||||
|
while (this.getTaskCount() > 5_000) {
|
||||||
|
try {
|
||||||
|
Thread.sleep(10);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.saveQueue.add(new SaveEntry(in, section));
|
this.saveQueue.add(new SaveEntry(in, section));
|
||||||
this.threads.execute();
|
this.threads.execute();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"voxy.config.title": "Voxy config",
|
"voxy.config.title": "Voxy",
|
||||||
|
|
||||||
"voxy.config.general.enabled": "Enable Voxy",
|
"voxy.config.general.enabled": "Enable Voxy",
|
||||||
"voxy.config.general.enabled.tooltip": "Fully enables or disables voxy",
|
"voxy.config.general.enabled.tooltip": "Fully enables or disables voxy",
|
||||||
|
|||||||
Reference in New Issue
Block a user