Is it possible to add some parameters for automatic cache release from idle tabs in oxygen xml editor and a button
Posted: Thu Nov 02, 2023 10:23 am
Hi,
Is it possible to add a feature that, when the occupied memory of an application reaches a threshold (make it a paramter), for example, 90% of the total memory this application can consume (for example, 4000MB, the parameter could be maxMem), then release the cache of threads that have been idle for more than x minutes (this parameter can be named as idleDuration or something similar). Also, add a button that allows users to release the cache manually.
The func spec could be something like follows:
Function Name: ReleaseIdleCache
Parameters:
- maxMem: The maximum memory that the application can consume (in MB).
- idleDuration: The duration in minutes after which a thread is considered idle.
Return Type: None
Description:
This function monitors the occupied memory of an application and releases the cache of threads that have been idle for more than a specified duration. The function takes two parameters: `maxMem` and `idleDuration`. When the occupied memory reaches a threshold (e.g., 90% of `maxMem`), the function identifies the idle threads based on the `idleDuration` and releases their cache. Additionally, users can manually trigger the cache release by calling a separate function. (see Function Name: ManualCacheRelease)
Algorithm:
1. Retrieve the current occupied memory of the application.
2. Calculate the memory threshold by multiplying `maxMem` with 0.9.
3. If the occupied memory exceeds the threshold:
- Retrieve the list of threads and their respective last activity timestamps.
- Iterate through each thread:
- If the difference between the current timestamp and the last activity timestamp is greater than or equal to `idleDuration`, release the thread's cache.
4. Return from the function.
Function Name: ManualCacheRelease
Parameters: None
Return Type: None
Description:
This function allows users to manually release the cache of idle threads. When called, it identifies the idle threads based on a specified duration and releases their cache.
Algorithm:
1. Retrieve the list of threads and their respective last activity timestamps.
2. Iterate through each thread:
- If the difference between the current timestamp and the last activity timestamp is greater than or equal to a specified duration, release the thread's cache.
3. Return from the function.
--------------------------
Background:
As for as I observed, the max memory that oXygen v25.1 (without modifying default settings) can consume on my machine is 4000MB. When I open multiple tabs for various dita topics and maps, the memory could reach 4000MB very easily. For those opened and saved topics that have been idle for like minutes, the oxygen application does not release the cache, thus, oxygen v25.1 is more likely to hang when the occupied memory reaches 4000MB, for example, 3997/4000MB at the bottom right corner.
Here's my machine's specs:
Device name pollos-hermano
Processor Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz 2.90 GHz
Installed RAM 32.0 GB
System type 64-bit operating system, x64-based processor
Edition Windows 11 Pro Insider Preview
Version 22H2
Installed on 2023/10/31
OS build 23575.1001
Experience Windows Feature Experience Pack 1000.23575.1001.0
I think the RAM is big enough to run the oxygen but if the memory consumption mechanism doesn't change, even if I modify the maxMem of oxygen at somewhere and make it like 16 GB, similar issue could still occur...
Is it possible to add a feature that, when the occupied memory of an application reaches a threshold (make it a paramter), for example, 90% of the total memory this application can consume (for example, 4000MB, the parameter could be maxMem), then release the cache of threads that have been idle for more than x minutes (this parameter can be named as idleDuration or something similar). Also, add a button that allows users to release the cache manually.
The func spec could be something like follows:
Function Name: ReleaseIdleCache
Parameters:
- maxMem: The maximum memory that the application can consume (in MB).
- idleDuration: The duration in minutes after which a thread is considered idle.
Return Type: None
Description:
This function monitors the occupied memory of an application and releases the cache of threads that have been idle for more than a specified duration. The function takes two parameters: `maxMem` and `idleDuration`. When the occupied memory reaches a threshold (e.g., 90% of `maxMem`), the function identifies the idle threads based on the `idleDuration` and releases their cache. Additionally, users can manually trigger the cache release by calling a separate function. (see Function Name: ManualCacheRelease)
Algorithm:
1. Retrieve the current occupied memory of the application.
2. Calculate the memory threshold by multiplying `maxMem` with 0.9.
3. If the occupied memory exceeds the threshold:
- Retrieve the list of threads and their respective last activity timestamps.
- Iterate through each thread:
- If the difference between the current timestamp and the last activity timestamp is greater than or equal to `idleDuration`, release the thread's cache.
4. Return from the function.
Function Name: ManualCacheRelease
Parameters: None
Return Type: None
Description:
This function allows users to manually release the cache of idle threads. When called, it identifies the idle threads based on a specified duration and releases their cache.
Algorithm:
1. Retrieve the list of threads and their respective last activity timestamps.
2. Iterate through each thread:
- If the difference between the current timestamp and the last activity timestamp is greater than or equal to a specified duration, release the thread's cache.
3. Return from the function.
--------------------------
Background:
As for as I observed, the max memory that oXygen v25.1 (without modifying default settings) can consume on my machine is 4000MB. When I open multiple tabs for various dita topics and maps, the memory could reach 4000MB very easily. For those opened and saved topics that have been idle for like minutes, the oxygen application does not release the cache, thus, oxygen v25.1 is more likely to hang when the occupied memory reaches 4000MB, for example, 3997/4000MB at the bottom right corner.
Here's my machine's specs:
Device name pollos-hermano
Processor Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz 2.90 GHz
Installed RAM 32.0 GB
System type 64-bit operating system, x64-based processor
Edition Windows 11 Pro Insider Preview
Version 22H2
Installed on 2023/10/31
OS build 23575.1001
Experience Windows Feature Experience Pack 1000.23575.1001.0
I think the RAM is big enough to run the oxygen but if the memory consumption mechanism doesn't change, even if I modify the maxMem of oxygen at somewhere and make it like 16 GB, similar issue could still occur...