All Downloads are FREE. Search and download functionalities are using the official Maven repository.

desktopMain.com.seiko.imageloader.cache.memory.MemoryCacheBuilder.desktop.kt Maven / Gradle / Ivy

There is a newer version: 1.9.0
Show newest version
package com.seiko.imageloader.cache.memory

fun MemoryCacheBuilder.maxSizePercent(percent: Double = STANDARD_MEMORY_MULTIPLIER) {
    val memoryClassMegabytes = Runtime.getRuntime().totalMemory()
    val maxSizeBytes = (percent * memoryClassMegabytes * 1024 * 1024).toInt()
    maxSizeBytes(maxSizeBytes)
}

private const val STANDARD_MEMORY_MULTIPLIER = 0.2




© 2015 - 2025 Weber Informatics LLC | Privacy Policy