Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Method closures & memory usage

New Here ,
Apr 08, 2015 Apr 08, 2015

Greetings everyone.

I am hopeful someone may be able to provide me with some insight.

I inherited a rather large Flash Builder project to maintain. One of the principle complaints has been the program consumes a great deal of memory, and as memory increases, the flash virtual machine becomes sluggish.

Memory usage is actually fairly stable, from what I have been able to determine, by profiling with Scout. While I am sure there are some memory leaks in places, memory usage in the application will generally start off low, increase substantially as the application ramps up and starts to activate various features, and then level off and remain fairly consistent. Naturally if people leave the app open on their desktop for days at a time, there will be some minor memory creep, but overall, not a significant amount.

To the point of my question:

While profiling, Scout is reporting the largest number of objects, and memory usage, is allocated to "Method Closures". To the tune of 50k of these things consuming over 10MB of memory.

Googling around, I find some descriptions of method closures and how they work, but I am

a) having a difficult time getting my head around the concept of exactly what a method closure is, and why it is created within the program. Can someone provide a good example, and perhaps enumerate the conditions under which flash will create a method closure?

b) is there a way to reduce the number of method closures? ( I guess this really depends on understanding (a) and thus generating code which does not result in a method closure)

c) is there a way to reduce the amount of memory being allocated to these closures.

Since I do not have anywhere near 50k objects within this application, I'm somewhat at a loss to understand why I have 50k of these things being allocated.

Any insight would be appreciated.

TOPICS
ActionScript
337
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation