Skip to content

Commit 9d5dc0c

Browse files
committed
More permission low memory handling
1 parent 8f0e789 commit 9d5dc0c

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

app/src/main/kotlin/com/njlabs/showjava/decompilers/BaseDecompiler.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ abstract class BaseDecompiler(val context: Context, val data: Data) {
118118

119119
private fun monitorMemory() {
120120
disposables.add(
121-
Observable.interval(1, TimeUnit.SECONDS)
121+
Observable.interval(1000, TimeUnit.MILLISECONDS)
122122
.subscribeOn(Schedulers.io())
123123
.observeOn(Schedulers.io())
124124
.subscribe {
@@ -136,7 +136,7 @@ abstract class BaseDecompiler(val context: Context, val data: Data) {
136136
broadcastStatus("memory", "%.2f".format(usedPercentage), "memory")
137137

138138
if (usedPercentage > memoryThreshold) {
139-
if (memoryThresholdCrossCount > 1) {
139+
if (memoryThresholdCrossCount > 2) {
140140
onLowMemory?.invoke(true)
141141
} else {
142142
memoryThresholdCrossCount++

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@
146146
<string name="showMemoryUsageSummary">Display live app memory usage on the decompiler screen</string>
147147
<string name="lowMemory">Low memory</string>
148148
<string name="lowMemoryInfo">The selected decompiler ran out of RAM while attempting to decompile</string>
149-
<string name="lowMemoryExtraInfo">Try reducing the classes per chunk (in settings) and/or pick another decompiler.</string>
149+
<string name="lowMemoryExtraInfo">Try reducing the classes per chunk or increasing memory threshold and/or pick another decompiler.</string>
150150
<string name="lowMemoryStatusInfo">Ran out of RAM. Tap for more info.</string>
151151
<string name="memoryThreshold">Memory usage threshold (in %)</string>
152152
<string name="darkMode">Dark mode (Beta)</string>

0 commit comments

Comments
 (0)