memory munching group

David V Glasgow dvglasgow at gmail.com
Fri May 8 10:35:12 EDT 2015


Hello folks,

I am hesitant to call this a memory leak problem, but it doesn’t seem far off.

I have a group consisting of an array of 18x 5 button radio buttons, each set prepended by a field labelling the scale.

All the buttons, and label fields contain a custom property (csplain) consisting of explanatory text/advice.  This appears as a multiline tooltip style field if the mouse lingers within the object for more than 500ms.

The delay is created by a send  in time message (‘stillin') triggered by mouseenter.  The ’stillin’  script is:

on stillin
   global gtarget
   if the mouseloc is not within the rect of gtarget then 
      hide field “splain"
      exit to top
   end if

- - Bails if mouse pointer has moved out of object in < .5 sec


   if the first word of gtarget is "field" then set the textcolor of gtarget to red

- - if a field then -> red text

   put the csplain of  gtarget into field "splain"
   set the height of field "splain" to the formattedHeight of field  “splain"
   set the topleft of field "splain" to the topright  of gtarget
   put (height of this stack -the bottom of field splain) into toffset
   if toffset <  0

- - Check if splain extends off screen.  If it does, shift up.


   then
      get the loc of field splain
      put (item 2 of it+toffset - 10) into item 2 of it
      set the loc of  field splain to it
   end if
   show field "splain" with visual effect wipe down very fast   
end stillin   



Some of the explanatory csplain text is very brief, some maybe 50 or 60 words.  An example is:

“This is an important scale for the Non-Psychotic Supercluster (Especially in the absence of 'Other mental & behavioural problems' (item 8))

* Do not include over-activity or agitation, rated at Scale 1
* Do not include suicidal ideation or attempts, rated at Scale 2
* Do not include delusions or hallucinations, rated at Scale 6”


I first noticed something odd when I ran a quick test in a minimally specced Windows in VM.  I noodled about looking at the text appearing and disappearing as it should, when the standalone crashed.  I ran it on a physical machine, and it didn’t crash under Win 7 or Vista, but I did notice the memory allocation embiggening with most, but not all, appearances of the tool tip - between .2 & .7 MB a time.  The memory was never released when left alone or navigated to another stack.

I then discovered the same thing happening on Mac with standalone, and in the dev environment.

I created a test stack with nothing but 6 buttons in a group containing the same script.  Nothing happened.  Well, nothing happened that shouldn’t happen.

Any suggestions about what might be going on here?  

Best wishes,

David Glasgow





More information about the use-livecode mailing list