hetima / simbl

Automatically exported from code.google.com/p/simbl
2 stars 1 forks source link

Memory Leaks #30

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

there's a memory leak - try running Instruments on any app that will load a 
SIMBL plugin - you get 
memory leaks from SIMBL. The problem is that the SIMBLPlugin class doesn't have 
a -dealloc method 
releasing the path and info objects.

Here's a backtrace in one of my apps:

  34 VideoApp 0x1
  33 VideoApp start
  32 VideoApp main /Users/alto/Cocoa Development/VideoApp/main.m:14
  31 AppKit NSApplicationMain
  30 AppKit -[NSApplication run]
  29 AppKit -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]
  28 AppKit _DPSNextEvent
  27 HIToolbox AEProcessAppleEvent
  26 AE aeProcessAppleEvent
  25 AE dispatchEventAndSendReply(AEDesc const*, AEDesc*)
  24 AE aeDispatchAppleEvent(AEDesc const*, AEDesc*, unsigned long, unsigned char*)
  23 OpenScripting EventHandlerThunk(AEDesc const*, AEDesc*, long)
  22 SIMBL InjectEventHandler
  21 SIMBL +[SIMBL installPlugins]
  20 SIMBL +[SIMBL loadBundleAtPath:]
  19 SIMBL +[SIMBL shouldLoadBundleAtPath:]
  18 SIMBL +[SIMBL shouldApplication:loadBundleAtPath:]
  17 SIMBL +[SIMBLPlugin bundleWithPath:]
  16 SIMBL -[SIMBLPlugin initWithPath:]
  15 Foundation +[NSDictionary(NSDictionary) dictionaryWithContentsOfFile:]
  14 CoreFoundation -[__NSPlaceholderDictionary initWithContentsOfFile:]
  13 Foundation +[NSDictionary(NSDictionary) newWithContentsOf:immutable:]
  12 Foundation _NSParseObjectFromASCIIPropertyListOrSerialization
  11 CoreFoundation CFPropertyListCreateFromXMLData
  10 CoreFoundation CFPropertyListCreateWithData
   9 CoreFoundation _CFPropertyListCreateWithData
   8 CoreFoundation _CFPropertyListCreateFromXMLStringError
   7 CoreFoundation parseXMLElement
   6 CoreFoundation parsePListTag
   5 CoreFoundation parseXMLElement
   4 CoreFoundation parseXMLElement
   3 CoreFoundation parseArrayTag
   2 CoreFoundation CFArrayAppendValue
   1 CoreFoundation _CFArrayReplaceValues
   0 libSystem.B.dylib malloc_zone_malloc

Cheers,

Charlie

Original issue reported on code.google.com by untitled...@gmail.com on 3 Feb 2010 at 9:50

GoogleCodeExporter commented 9 years ago
Adding a dealloc method is correct, however I am not able to reproduce this 
leak with Instruments.

Original comment by ms...@gmail.com on 11 Apr 2010 at 11:40

GoogleCodeExporter commented 9 years ago
Forgot to mention I'm on 10.6.2 (10.6.3 now). If there is anything I can do, 
let me know.

Charlie

Original comment by untitled...@gmail.com on 12 Apr 2010 at 10:34

GoogleCodeExporter commented 9 years ago
Not sure if this is directly related to this ticket, but I am seeing a crazy 
high vsize in top. See the attachment - vsize is at 11G

System: 10.6.4

Original comment by toolbag on 6 Jul 2010 at 6:21

Attachments:

GoogleCodeExporter commented 9 years ago
Neglected to include this earlier, my SIMBL version is the latest 0.9.7a

Original comment by toolbag on 6 Jul 2010 at 6:43

GoogleCodeExporter commented 9 years ago
it's not that top is lying per-se, more that its version of the truth is not 
relevant. vsize is not actual memory use. rsize is closer, but that too is 
wrong. if you want the *real* answer, you have to manually scan and account for 
every shared library properly.

anyway, the short answer is that your observation has nothing to do with this 
leak. if you restart the agent, it's vsize will jump back to some incredible, 
but harmless number of gigabytes.

Original comment by ms...@gmail.com on 6 Jul 2010 at 7:02

GoogleCodeExporter commented 9 years ago
I can reproduce this with TextEdit.app and AFloat [1] and Visor [2] installed.
Initially, no memory is leaked, but after closing the default document and 
creating a new document, I can detect the memory leaks with leaks(1) [3].

I also have added a -(void)dealloc method to SIMBLPlugin and that fixes the 
leaks for me. The changes are attached to this comment.

[1] http://infinite-labs.net/afloat/
[2] http://visor.binaryage.com/
[3] 
http://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/m
an1/leaks.1.html

Original comment by m...@howaboutanorange.com on 7 Oct 2010 at 3:55

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago

Original comment by ms...@gmail.com on 12 Oct 2010 at 5:42