Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008551opensim[REGION] Scripting Enginepublic2019-06-19 10:222019-11-18 09:34
ReporterZauberParacelsus 
Assigned ToUbitUmarov 
PrioritynormalSeveritymajorReproducibilityalways
StatusassignedResolutionopen 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0008551: YEngine leaking memory from strings in event
DescriptionThere is a memory leak in YEngine with any events that have string arguments. Events such as listen, link_message, http_request, http_response, dataserver, etc.

The memory from the string arguments does not appear to be cleared when the event exits, and as a workaround you must manually clear the string.

Curiously, the memory appears to be getting cleared on a region restart, or when you relog in the case of scripted avatar attachments.
Steps To ReproduceThe script below exhibits the problem, and memory usage will increase by 22 bytes with each click.

default {
    touch_start(integer num) {
        llMessageLinked(LINK_THIS, 0, "MEMORY LEAK", NULL_KEY);
    }
    
    link_message(integer link, integer num, string msg, key id) {
        llOwnerSay((string)llGetUsedMemory());
    }
}
TagsNo tags attached.
Git Revision or version number
Run Mode Grid (1 Region per Sim)
Physics EngineubODE
Script Engine
EnvironmentMono / Linux64
Mono Version5.x
Viewer
Attached Files

- Relationships

-  Notes
(0035410)
BillBlight (developer)
2019-06-19 10:43
edited on: 2019-06-19 10:55

can confirm this is an issue .. Work around until fixed is clearing the variables after they are used, as stated in this mantis ..

default {
    touch_start(integer num) {
        llMessageLinked(LINK_THIS, 0, "MEMORY LEAK", NULL_KEY);
    }
    
    link_message(integer link, integer num, string msg, key id) {
        llOwnerSay((string)llGetUsedMemory());
        msg=""; //clear the msg variable after use.
    }
}


Not really a leak more of an accumulation on uncleared variable memory space.

(0035411)
ZauberParacelsus (reporter)
2019-06-19 10:59
edited on: 2019-06-19 11:00

...more of an accumulation on uncleared variable memory space.


Isn't that what a memory leak is?

EDIT: Regardless though, this can result in an OutOfHeapException

(0035412)
BillBlight (developer)
2019-06-19 11:02

technically a leak occurs without user interaction or active functions .. I know a minor difference but this takes activity to accumulate.


Yes OutOfHeap is the end result ...
(0035888)
UbitUmarov (administrator)
2019-11-18 09:34

Change master (0.9.1.1) on this

- Issue History
Date Modified Username Field Change
2019-06-19 10:22 ZauberParacelsus New Issue
2019-06-19 10:43 BillBlight Note Added: 0035410
2019-06-19 10:43 BillBlight Assigned To => UbitUmarov
2019-06-19 10:43 BillBlight Status new => assigned
2019-06-19 10:46 BillBlight Note Edited: 0035410 View Revisions
2019-06-19 10:55 BillBlight Note Edited: 0035410 View Revisions
2019-06-19 10:59 ZauberParacelsus Note Added: 0035411
2019-06-19 11:00 ZauberParacelsus Note Edited: 0035411 View Revisions
2019-06-19 11:02 BillBlight Note Added: 0035412
2019-11-18 09:34 UbitUmarov Note Added: 0035888


Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker