Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008590opensim[REGION] OpenSim Corepublic2019-09-27 11:592019-10-02 03:39
ReporterKubwa 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusnewResolutionopen 
Platformx64OSWindowsOS Version10
Product Version0.9.0.1 
Target VersionFixed in Version 
Summary0008590: Memoryleak Flotsam Cache
DescriptionWhen using in memory flotsam cache only, there is a memory leak which lets a region eat more and more ram over time. The cleanup time seems to have no effect.
After a while, the region eats all the servers ram.

Enabling filesystem cache and turning off memory cache does not has that problem.
Steps To ReproduceMy Flotsam Cache Ini


[AssetCache]
    ;;
    ;; Options for FlotsamAssetCache
    ;;

    ; cache directory can be shared by multiple instances
    ;CacheDirectory = J:/
    ; Other examples:
    ;CacheDirectory = /directory/writable/by/OpenSim/instance

    ; Log level
    ; 0 - (Error) Errors only
    ; 1 - (Info) Hit Rate Stats + Level 0
    ; 2 - (Debug) Cache Activity (Reads/Writes) + Level 1
    ;
    LogLevel = 0

    ; How often should hit rates be displayed (given in AssetRequests)
    ; 0 to disable
    HitRateDisplay = 100

    ; Set to false for no memory cache
    MemoryCacheEnabled = true

    ; Set to false for no file cache
    FileCacheEnabled = false

    ; How long {in hours} to keep assets cached in memory, .5 == 30 minutes
    ; Optimization: for VPS or limited memory system installs set Timeout to .016 (1 minute)
    ; increases performance without large memory impact
    MemoryCacheTimeout = 24

    ; How long {in hours} to keep assets cached on disk, .5 == 30 minutes
    ; Specify 0 if you do not want your disk cache to expire
    FileCacheTimeout = 96

    ; How often {in hours} should the disk be checked for expired files
    ; Specify 0 to disable expiration checking
    FileCleanupTimer = 12

    ; If WAIT_ON_INPROGRESS_REQUESTS has been defined then this specifies how
    ; long (in miliseconds) to block a request thread while trying to complete
    ; an existing write to disk.
    ; NOTE: THIS PARAMETER IS NOT CURRENTLY USED BY THE CACHE
    ;WaitOnInprogressTimeout = 3000

    ; Number of tiers to use for cache directories (current valid
    ; range 1 to 3)
    CacheDirectoryTiers = 2

    ; Number of letters per path tier, 1 will create 16 directories
    ; per tier, 2 - 256, 3 - 4096 and 4 - 65K
    CacheDirectoryTierLength = 1

    ; Warning level for cache directory size
    CacheWarnAt = 256000

TagsNo tags attached.
Git Revision or version number
Run Mode Grid (1 Region per Sim)
Physics EngineubODE
Environment.NET / Windows64
Mono VersionNone
Viewer
Attached Files

- Relationships

-  Notes
(0035694)
Kubwa (reporter)
2019-09-27 12:17

Region console shows that assets in memory cache are never cleaned up:

Memory Cache: 104127 assets
File cache disabled
Total requests: 592947
unCollected Hit Rate: 72.04% (104291 entries)
File Hit Rate: 0.00%
Memory Hit Rate: 0.00%
Total Hit Rate: 72.04%
Requests overlap during file writing: 0
(0035695)
BillBlight (developer)
2019-09-27 12:31

Well you have the timeout set to 24 hours, so have you tested it with lower numbers?

At that setting it memory is going to get pretty big.
(0035696)
UbitUmarov (administrator)
2019-09-27 13:04

-Memory cache SHOULD NOT be used.
 this is still a problem intrinsic to Garbage Collect both on win and mono.

if used better have a unlimit timeout, effectively loading all assets in memory, fine if you want that.

with apparently reasonable timeout setting, it ill drop expired assets, but garbage collector is no long tracking their memory, and it stay allocated, s a memory leak.
(0035697)
UbitUmarov (administrator)
2019-09-27 13:06

Microsoft did introduced a special Cache object, suposely to overcome this issues
but reports in web show it does the same, reason why we did not changed to it
(0035698)
Kubwa (reporter)
2019-09-27 22:58

If memory cache should not be used, why is it still existing? And why isnt there any informations in the config about this issue?
(0035699)
UbitUmarov (administrator)
2019-09-28 11:47
edited on: 2019-09-28 11:53

Because we are suposed to have it. Meanwhile MS may actually fix CG (both win and mono), without the need of using another unmanaged library, as some do. just because the religion that forbids GC from having damm FREE methods

(0035702)
Total Sorbet (reporter)
2019-10-02 03:39

As workaround in the past I created ramdisk and used in place of usual disk cache... works really good :)

- Issue History
Date Modified Username Field Change
2019-09-27 11:59 Kubwa New Issue
2019-09-27 12:17 Kubwa Note Added: 0035694
2019-09-27 12:31 BillBlight Note Added: 0035695
2019-09-27 13:04 UbitUmarov Note Added: 0035696
2019-09-27 13:06 UbitUmarov Note Added: 0035697
2019-09-27 22:58 Kubwa Note Added: 0035698
2019-09-28 11:47 UbitUmarov Note Added: 0035699
2019-09-28 11:53 UbitUmarov Note Edited: 0035699 View Revisions
2019-10-02 03:39 Total Sorbet Note Added: 0035702


Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker