Skip to content

Commit 9358167

Browse files
committed
#0000 Service: Optimization of automatic resource clean-up
1 parent 84ea6a9 commit 9358167

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

CHANGES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ BF: Windows: Correction of the missing second start parameter in the batch scrip
1515
BF: HTTP(S): Correction of the Accept header when using CGI
1616
The server has incorrectly determined the content type for the CGI.
1717
Now the CGI must take care of the Accept header, as it should.
18+
BF: Service: Optimization of automatic resource clean-up
1819
CR: Unix/Linux: Optimization of bash scripts and runtime directory handling
1920
- Optimization of JRE determination in the runtime directory
2021
The Directory name does not matter, it is searched for files ./java,

sources/com/seanox/devwex/Service.java

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -926,21 +926,17 @@ public void run() {
926926
while (this.status < Service.STOP) {
927927

928928
Section section = this.initialize.get("common");
929-
if (section.get("cleanup").toLowerCase().equals("on"))
929+
930+
if (section.get("cleanup").toLowerCase().equals("on")) {
930931
count = Thread.activeCount();
931-
932-
if (total != count)
933-
delta = delta << 1;
934-
if (total > count)
935-
delta = delta | 1;
936-
937-
if ((delta & 0xFF) == 0xFF)
938-
System.gc();
939-
if ((delta & 0xFF) == 0xFF)
940-
delta = delta << 1;
941-
942-
delta = delta & 0xFF;
943-
total = count;
932+
if (count == total) {
933+
if (++delta >= 50)
934+
delta = 1;
935+
} else delta = -1;
936+
total = count;
937+
if (delta == 49)
938+
System.gc();
939+
}
944940

945941
if (section.get("reload").toLowerCase().equals("on")
946942
&& modified != this.configuration.lastModified()) {

0 commit comments

Comments
 (0)