Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007730opensim[REGION] OpenSim Corepublic2015-10-06 10:202015-11-20 11:25
Reporterfrost 
Assigned To 
PriorityhighSeveritymajorReproducibilityalways
StatusnewResolutionopen 
PlatformLinuxOSUbuntuOS Version14.04.3
Product Versionmaster (dev code) 
Target VersionFixed in Version 
Summary0007730: Memory leak when object moves between regions
DescriptionWhen an object moves from one region to another, memory is leaked.

I first found out on my production server, where I had a train running that crosses regions frequently. I have since reduced it to a simple test-case on two empty regions, by creating a prim and put a simple script in it (see below).

Note that I have tried this on the 0.8.1.1 download from opensimulator.org, the latest git master (0f6c3fb24265b8e63815e50e4b62c73a4cee31ac) as well as the metropolis version (metropolis-os_082_DEV_PLUS_LINUX, i first noticed the problem on the metropolis version before this one).

While the steps to reproduce run in a stand-alone instance, I also have this issue on my production sim, which is part of metropolis grid.
Steps To Reproduce1. Get/compile opensimulator
2. copy bin/OpenSim.ini.example to bin/OpenSim.ini, uncomment line:
     Include-Architecture = "config-include/Standalone.ini"
3. copy config-include/StandaloneCommon.ini.example to config-include/StandaloneCommon.ini
4. Create bin/Regions/Regions.ini:
    [test1]
    RegionUUID = 3ac041ad-80a2-48ac-b2b3-03e4148b990d
    Location = 1000, SizeX = 256
    SizeY = 256
    SizeZ = 256
    InternalAddress = 0.0.0.0
    InternalPort = 9000
    AllowAlternatePorts = False
    ExternalHostName = SYSTEMIP
    MaptileStaticUUID = 00000000-0000-0000-0000-000000000000

    [test2]
    RegionUUID = 606349e1-2385-4164-ba6b-282bf0bc98e7
    Location = 1000,1001
    SizeX = 256
    SizeY = 256
    SizeZ = 256
    InternalAddress = 0.0.0.0
    InternalPort = 9001
    AllowAlternatePorts = False
    ExternalHostName = SYSTEMIP
    MaptileStaticUUID = 00000000-0000-0000-0000-000000000000
5. mono OpenSim.exe -gui=true
6. Accept defaults, create Test User, join test2 to My Estate, etc
7. When opensim is ready (logins enabled), connect with your favourite viewer

(alternatively to step 8-10, the attached oar contains the box with script, just 'load oar memleak.oarĀ“ in region test1).

8. Create a prim (i used a box) in region test1
9. Add a script to the prim, replace the content with:

default
{
    state_entry()
    {
        llSay(0, "Script running");
        state forth;
    }
}
    
state forth
{
    state_entry()
    {
        llSetPos(<128,245,23>);
        llSetKeyframedMotion([<0,20,0>,5],[KFM_DATA,KFM_TRANSLATION,KFM_MODE,KFM_FORWARD]);
        llSetKeyframedMotion([], [KFM_COMMAND,KFM_CMD_PLAY]);
    }

    moving_end()
    {
        state back;
    }
}

state back
{
    state_entry()
    {
        llSetPos(<128,10,23>);
        llSetKeyframedMotion([<0,-20,0>,5],[KFM_DATA,KFM_TRANSLATION,KFM_MODE,KFM_FORWARD]);
        llSetKeyframedMotion([], [KFM_COMMAND,KFM_CMD_PLAY]);
    }

    moving_end()
    {
        state forth;
    }
}


10. Save the script, you now have a box that moves from region test1 into region test2 and back again ad infinitum
11. Watch the memory usage by the opensim process with your favourite tool, and see it go up and up and up until it crashes
Additional InformationI haven't actually tested this under windows, as I do not have access to windows privately.
TagsNo tags attached.
Git Revision or version number
Run Mode Standalone (Multiple Regions) , Grid (Multiple Regions per Sim)
Physics EngineBulletSim
Script Engine
EnvironmentMono / Linux64
Mono Version3.2
Viewer
Attached Files? file icon memleak.oar [^] (86,061 bytes) 2015-10-06 10:22

- Relationships

-  Notes
(0029499)
frost (reporter)
2015-10-06 10:25

The console shows nothing special, just this ad infinitum:

19:23:50 - [ENTITY TRANSFER MODULE] GetRegionContainingWorldLocation: Found region using legacy size. rloc=<256000,256000>. Rname=test1
19:23:55 - [ENTITY TRANSFER MODULE] GetRegionContainingWorldLocation: query, loc=<256128,256256>
19:23:55 - [LOCAL GRID SERVICE CONNECTOR] GetRegionByPosition. Found region test2 in cache (of region test1). Pos=<1000,1001>
19:23:55 - [ENTITY TRANSFER MODULE] GetRegionContainingWorldLocation: Found region using legacy size. rloc=<256000,256256>. Rname=test2
19:24:00 - [ENTITY TRANSFER MODULE] GetRegionContainingWorldLocation: query, loc=<256128,256255.800000191>
19:24:00 - [LOCAL GRID SERVICE CONNECTOR] GetRegionByPosition. Found region test1 in cache (of region test2). Pos=<1000,1000>
19:24:00 - [ENTITY TRANSFER MODULE] GetRegionContainingWorldLocation: Found region using legacy size. rloc=<256000,256000>. Rname=test1
19:24:06 - [ENTITY TRANSFER MODULE] GetRegionContainingWorldLocation: query, loc=<256128,256256>
19:24:06 - [LOCAL GRID SERVICE CONNECTOR] GetRegionByPosition. Found region test2 in cache (of region test1). Pos=<1000,1001>
19:24:06 - [ENTITY TRANSFER MODULE] GetRegionContainingWorldLocation: Found region using legacy size. rloc=<256000,256256>. Rname=test2
19:24:11 - [ENTITY TRANSFER MODULE] GetRegionContainingWorldLocation: query, loc=<256128,256255.800000191>
19:24:11 - [LOCAL GRID SERVICE CONNECTOR] GetRegionByPosition. Found region test1 in cache (of region test2). Pos=<1000,1000>
19:24:11 - [ENTITY TRANSFER MODULE] GetRegionContainingWorldLocation: Found region using legacy size. rloc=<256000,256000>. Rname=test1
19:24:16 - [ENTITY TRANSFER MODULE] GetRegionContainingWorldLocation: query, loc=<256128,256256>
19:24:16 - [LOCAL GRID SERVICE CONNECTOR] GetRegionByPosition. Found region test2 in cache (of region test1). Pos=<1000,1001>
19:24:16 - [ENTITY TRANSFER MODULE] GetRegionContainingWorldLocation: Found region using legacy size. rloc=<256000,256256>. Rname=test2
19:24:21 - [ENTITY TRANSFER MODULE] GetRegionContainingWorldLocation: query, loc=<256128,256255.800000191>
19:24:21 - [LOCAL GRID SERVICE CONNECTOR] GetRegionByPosition. Found region test1 in cache (of region test2). Pos=<1000,1000>
19:24:21 - [ENTITY TRANSFER MODULE] GetRegionContainingWorldLocation: Found region using legacy size. rloc=<256000,256000>. Rname=test1
19:24:27 - [ENTITY TRANSFER MODULE] GetRegionContainingWorldLocation: query, loc=<256128,256256>
19:24:27 - [LOCAL GRID SERVICE CONNECTOR] GetRegionByPosition. Found region test2 in cache (of region test1). Pos=<1000,1001>
19:24:27 - [ENTITY TRANSFER MODULE] GetRegionContainingWorldLocation: Found region using legacy size. rloc=<256000,256256>. Rname=test2
19:24:32 - [ENTITY TRANSFER MODULE] GetRegionContainingWorldLocation: query, loc=<256128,256255.800000191>
19:24:32 - [LOCAL GRID SERVICE CONNECTOR] GetRegionByPosition. Found region test1 in cache (of region test2). Pos=<1000,1000>
19:24:32 - [ENTITY TRANSFER MODULE] GetRegionContainingWorldLocation: Found region using legacy size. rloc=<256000,256000>. Rname=test1
19:24:37 - [ENTITY TRANSFER MODULE] GetRegionContainingWorldLocation: query, loc=<256128,256256>
19:24:37 - [LOCAL GRID SERVICE CONNECTOR] GetRegionByPosition. Found region test2 in cache (of region test1). Pos=<1000,1001>
19:24:37 - [ENTITY TRANSFER MODULE] GetRegionContainingWorldLocation: Found region using legacy size. rloc=<256000,256256>. Rname=test2
19:24:42 - [ENTITY TRANSFER MODULE] GetRegionContainingWorldLocation: query, loc=<256128,256255.800000191>
19:24:42 - [LOCAL GRID SERVICE CONNECTOR] GetRegionByPosition. Found region test1 in cache (of region test2). Pos=<1000,1000>
19:24:42 - [ENTITY TRANSFER MODULE] GetRegionContainingWorldLocation: Found region using legacy size. rloc=<256000,256000>. Rname=test1
19:24:48 - [ENTITY TRANSFER MODULE] GetRegionContainingWorldLocation: query, loc=<256128,256256>
19:24:48 - [LOCAL GRID SERVICE CONNECTOR] GetRegionByPosition. Found region test2 in cache (of region test1). Pos=<1000,1001>
19:24:48 - [ENTITY TRANSFER MODULE] GetRegionContainingWorldLocation: Found region using legacy size. rloc=<256000,256256>. Rname=test2
(0029500)
frost (reporter)
2015-10-06 10:27

Also, someone on IRC suggested a month ago to try toggle the AppDomainLoading setting in OpenSim.ini, but whether that is set to true or false seems to make no difference.
(0029501)
frost (reporter)
2015-10-06 12:06

Actually, scratch that. AppDomainLoading to false seems to make a difference.

I'll do some longer-running tests on both 0.8.1.1, master and avinationmerge branch in the coming days/weeks.
(0029588)
frost (reporter)
2015-11-20 10:56

I haven't forgotten, just been busy.
(0029589)
UbitUmarov (administrator)
2015-11-20 11:25

Actually crossing scripts at high rate with appDomain = false should cause some leak, since old script assemblies (dlls on scripts folder) can not be unloaded from memory. True, if really working on Linux, should unload, but at the cost of higher memory per script, and worse, lower script performance.

- Issue History
Date Modified Username Field Change
2015-10-06 10:20 frost New Issue
2015-10-06 10:22 frost File Added: memleak.oar
2015-10-06 10:24 frost Steps to Reproduce Updated View Revisions
2015-10-06 10:25 frost Note Added: 0029499
2015-10-06 10:27 frost Note Added: 0029500
2015-10-06 12:06 frost Note Added: 0029501
2015-11-20 10:56 frost Note Added: 0029588
2015-11-20 11:25 UbitUmarov Note Added: 0029589


Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker