mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Fix queue size being assigned to 0 on low end machines
This commit is contained in:
@ -1,5 +1,6 @@
|
|||||||
### Changelog
|
### Changelog
|
||||||
|
|
||||||
|
* Fix for queue size recommendation of 0GB RAM on low-end machines
|
||||||
* Fix for website readme compilation
|
* Fix for website readme compilation
|
||||||
* Fix for compiler downloads folder specification (was always standard path)
|
* Fix for compiler downloads folder specification (was always standard path)
|
||||||
|
|
||||||
|
@ -80,8 +80,9 @@ namespace Wabbajack.Lib
|
|||||||
const ulong GB = (1024 * 1024 * 1024);
|
const ulong GB = (1024 * 1024 * 1024);
|
||||||
// Most of the heavy lifting is done on the scratch disk, so we'll use the value from that disk
|
// Most of the heavy lifting is done on the scratch disk, so we'll use the value from that disk
|
||||||
var memory = Utils.GetMemoryStatus();
|
var memory = Utils.GetMemoryStatus();
|
||||||
// Assume roughly 2GB of ram needed to extract each 7zip archive, and then leave 2GB for the OS
|
// Assume roughly 2GB of ram needed to extract each 7zip archive, and then leave 2GB for the OS. If calculation is lower or equal to 1 GB, use 1GB
|
||||||
var based_on_memory = (memory.ullTotalPhys - (2 * GB)) / (2 * GB);
|
var memory_guess = (memory.ullTotalPhys - (2 * GB)) / (2 * GB);
|
||||||
|
var based_on_memory = (memory_guess <= (1 * GB)) ? (1 * GB) : memory_guess;
|
||||||
var scratch_size = await RecommendQueueSize(Directory.GetCurrentDirectory());
|
var scratch_size = await RecommendQueueSize(Directory.GetCurrentDirectory());
|
||||||
var result = Math.Min((int)based_on_memory, (int)scratch_size);
|
var result = Math.Min((int)based_on_memory, (int)scratch_size);
|
||||||
Utils.Log($"Recommending a queue size of {result} based on disk performance, number of cores, and {((long)memory.ullTotalPhys).ToFileSizeString()} of system RAM");
|
Utils.Log($"Recommending a queue size of {result} based on disk performance, number of cores, and {((long)memory.ullTotalPhys).ToFileSizeString()} of system RAM");
|
||||||
|
Reference in New Issue
Block a user