开发者

Why is NSColorPanel interaction accumulating memory?

Why does NSColorPanel accumulate memory usage? Try it:

  1. Create a brand new cocoa-based application in Xcode
  2. add a sinlge NSColorWell to the main window
  3. Run app and open a memory monitor (ex. Activity Monitor)
  4. Click the 开发者_如何学Ccolour well to bring up the NSColourPanel
  5. Click and drag your mouse on the colour wheel, twirling it around and around for a while, watching the app's memory usage

Result: Memory keeps climbing, slowly but surely (4-5Mb's in about a minute). In my tests, it seems to hit some sort of barrier after climbing about 4 megs, after which it stays somewhat steady, or climbs more slowly. And this is with garbage collection turned on. With it turned off, there seems to be no barrier; memory usage keeps climbing steadily.

This isn't a huge deal, practically-speaking. But it bothers me. I want to know what is going on with the memory, if such "leaks" (?) occur in other standard gui objects the developer may have no fine control over, and if this is just a gap in my understanding of how things work.

The only thing I can think of is perhaps the app is storing a history of selected colours for whatever reason (and this history keeps growing), but this seems unlikely to me.


File it at bugreport.apple.com.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜