Re: [swift-users] Memory Leak Indicated when Derived from NSObject

2016-12-20 Thread Chris Chirogene via swift-users
Wow. Thanks for the info. I am indeed seeing the leak on the iPad but not in 
the simulator. Same with your code. I am using the newest Xcode 8.2.1 (8C1002)
Please keep me posted and I’ll do the same.
Thanks!
Chris

On Dec 20, 2016, at 2:02 AM, Ray Fix 
> wrote:

Thanks for the update Chris.  Hmm...

So, I get memory runtime issues if I run this on an actual device iPad Air 2 
(iOS 10.2) with Version 8.2 (8C38).  Can’t get it to happen on the simulator. 
Can’t get it to happen if I make a macOS command line tool and inspect it with 
the leaks command.

(I reported this as radar 29715025 but if anyone has any insights please share! 
 )

Thank you,
Ray Fix





import UIKit


class Thing {}

class Test: NSObject
{
static let shared = Test()
var dictionary: [String: Thing] = [:]

func method() {
dictionary = ["value": Thing()]
}
}

class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
Test.shared.method()
print("Leaky leaky... click on the memory visualizer to see issues.")
}
}


When I click the memory visualizer it shows:

Memory Issues – (3 leaked types) Group
runtime: Memory Issues – (3 leaked types): 1 instance of 
_NativeDictionaryStorageImpl leaked
x-xcode-debug-memory-graph://7fa607cb92c0/4296: runtime: Memory Issues: 
0x1700f9f80
runtime: Memory Issues – (3 leaked types): 1 instance of 
_NativeDictionaryStorageOwner leaked
x-xcode-debug-memory-graph://7fa607cb92c0/5924: runtime: Memory Issues: 
0x170271dc0
runtime: Memory Issues – (3 leaked types): 1 instance of Thing leaked
x-xcode-debug-memory-graph://7fa607cb92c0/1891: runtime: Memory Issues: 
0x170019ca0




On Dec 17, 2016, at 12:12 AM, Chris Chirogene 
> wrote:

Interesting. Thanks. I’ll have to try that.
The latest Xcode 8.2 release version seems to have fixed this. I am no longer 
seeing the leak.
Take care,
Chris

On 17 Dec 2016, at 02:33, Ray Fix > 
wrote:

FWIW, seeing this too.  Also, when I boiled the project down to a macOS command 
line and run the “leaks" cli I don’t see the leak. 樂

Ray

On Oct 14, 2016, at 9:42 AM, Chris Chirogene via swift-users 
> wrote:

Xcode8 is showing a memory leak in instruments and the memory graph. I have 
narrowed it down to this: deriving from NSObject produces a leak indication. I 
have no idea why.
I need an NSObject to later use the @objc directive.
The Test instance stored in the mDict Dictionary is indicated as a leak in 
Xcode.
This is running as an iOS Single-View-Application project in the iPhone5s 
Simulator running iOS10.0
Here is the sample code:

 import Foundation

 class Test: NSObject  // <-- derived from NSObject produces leak indication 
below
 {
 static var cTest: Test! = nil
 var mDict: [String : Test] = Dictionary()

 static func test() -> Void {
 cTest = Test()
 cTest.mDict["test"] = Test() // <-- alleged leak
 }
 }

 class Test  // <-- NOT derived from NSObject, NO leak indication
 {
 static var cTest: Test! = nil
 var mDict: [String : Test] = Dictionary()

 static func test() -> Void {
 cTest = Test()
 cTest.mDict["test"] = Test() // <-- NO leak
 }
 }

 // from AppDelegate didFinishLaunchingWithOptions
 // ...
 Test.test()
 // ...

___
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users




___
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users


Re: [swift-users] Memory Leak Indicated when Derived from NSObject

2016-12-19 Thread Ray Fix via swift-users
Thanks for the update Chris.  Hmm...

So, I get memory runtime issues if I run this on an actual device iPad Air 2 
(iOS 10.2) with Version 8.2 (8C38).  Can’t get it to happen on the simulator. 
Can’t get it to happen if I make a macOS command line tool and inspect it with 
the leaks command.

(I reported this as radar 29715025 but if anyone has any insights please share! 
 )

Thank you,
Ray Fix





import UIKit


class Thing {}

class Test: NSObject
{
static let shared = Test()
var dictionary: [String: Thing] = [:]

func method() {
dictionary = ["value": Thing()]
}
}

class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
Test.shared.method()
print("Leaky leaky... click on the memory visualizer to see issues.")
}
}


When I click the memory visualizer it shows:

Memory Issues – (3 leaked types) Group
runtime: Memory Issues – (3 leaked types): 1 instance of 
_NativeDictionaryStorageImpl leaked
x-xcode-debug-memory-graph://7fa607cb92c0/4296: runtime: Memory Issues: 
0x1700f9f80
runtime: Memory Issues – (3 leaked types): 1 instance of 
_NativeDictionaryStorageOwner leaked
x-xcode-debug-memory-graph://7fa607cb92c0/5924: runtime: Memory Issues: 
0x170271dc0
runtime: Memory Issues – (3 leaked types): 1 instance of Thing leaked
x-xcode-debug-memory-graph://7fa607cb92c0/1891: runtime: Memory Issues: 
0x170019ca0




> On Dec 17, 2016, at 12:12 AM, Chris Chirogene  wrote:
> 
> Interesting. Thanks. I’ll have to try that.
> The latest Xcode 8.2 release version seems to have fixed this. I am no longer 
> seeing the leak.
> Take care,
> Chris
> 
>> On 17 Dec 2016, at 02:33, Ray Fix  wrote:
>> 
>> FWIW, seeing this too.  Also, when I boiled the project down to a macOS 
>> command line and run the “leaks" cli I don’t see the leak. 樂  
>> 
>> Ray
>> 
>>> On Oct 14, 2016, at 9:42 AM, Chris Chirogene via swift-users 
>>>  wrote:
>>> 
>>> Xcode8 is showing a memory leak in instruments and the memory graph. I have 
>>> narrowed it down to this: deriving from NSObject produces a leak 
>>> indication. I have no idea why.
>>> I need an NSObject to later use the @objc directive.
>>> The Test instance stored in the mDict Dictionary is indicated as a leak in 
>>> Xcode.
>>> This is running as an iOS Single-View-Application project in the iPhone5s 
>>> Simulator running iOS10.0
>>> Here is the sample code:
>>> 
>>>  import Foundation
>>> 
>>>  class Test: NSObject  // <-- derived from NSObject produces leak 
>>> indication below
>>>  {
>>>  static var cTest: Test! = nil
>>>  var mDict: [String : Test] = Dictionary()
>>> 
>>>  static func test() -> Void {
>>>  cTest = Test()
>>>  cTest.mDict["test"] = Test() // <-- alleged leak
>>>  }
>>>  }
>>> 
>>>  class Test  // <-- NOT derived from NSObject, NO leak indication
>>>  {
>>>  static var cTest: Test! = nil
>>>  var mDict: [String : Test] = Dictionary()
>>> 
>>>  static func test() -> Void {
>>>  cTest = Test()
>>>  cTest.mDict["test"] = Test() // <-- NO leak
>>>  }
>>>  }
>>> 
>>>  // from AppDelegate didFinishLaunchingWithOptions
>>>  // ...
>>>  Test.test()
>>>  // ...
>>> 
>>> ___
>>> swift-users mailing list
>>> swift-users@swift.org
>>> https://lists.swift.org/mailman/listinfo/swift-users
>> 
> 

___
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users


Re: [swift-users] Memory Leak Indicated when Derived from NSObject

2016-12-19 Thread Chris Chirogene via swift-users
Interesting. Thanks. I’ll have to try that.
The latest Xcode 8.2 release version seems to have fixed this. I am no longer 
seeing the leak.
Take care,
Chris

> On 17 Dec 2016, at 02:33, Ray Fix  wrote:
> 
> FWIW, seeing this too.  Also, when I boiled the project down to a macOS 
> command line and run the “leaks" cli I don’t see the leak. 樂  
> 
> Ray
> 
>> On Oct 14, 2016, at 9:42 AM, Chris Chirogene via swift-users 
>>  wrote:
>> 
>> Xcode8 is showing a memory leak in instruments and the memory graph. I have 
>> narrowed it down to this: deriving from NSObject produces a leak indication. 
>> I have no idea why.
>> I need an NSObject to later use the @objc directive.
>> The Test instance stored in the mDict Dictionary is indicated as a leak in 
>> Xcode.
>> This is running as an iOS Single-View-Application project in the iPhone5s 
>> Simulator running iOS10.0
>> Here is the sample code:
>> 
>>   import Foundation
>> 
>>   class Test: NSObject  // <-- derived from NSObject produces leak 
>> indication below
>>   {
>>   static var cTest: Test! = nil
>>   var mDict: [String : Test] = Dictionary()
>> 
>>   static func test() -> Void {
>>   cTest = Test()
>>   cTest.mDict["test"] = Test() // <-- alleged leak
>>   }
>>   }
>> 
>>   class Test  // <-- NOT derived from NSObject, NO leak indication
>>   {
>>   static var cTest: Test! = nil
>>   var mDict: [String : Test] = Dictionary()
>> 
>>   static func test() -> Void {
>>   cTest = Test()
>>   cTest.mDict["test"] = Test() // <-- NO leak
>>   }
>>   }
>> 
>>   // from AppDelegate didFinishLaunchingWithOptions
>>   // ...
>>   Test.test()
>>   // ...
>> 
>> ___
>> swift-users mailing list
>> swift-users@swift.org
>> https://lists.swift.org/mailman/listinfo/swift-users
> 

___
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users


Re: [swift-users] Memory Leak Indicated when Derived from NSObject

2016-12-16 Thread Ray Fix via swift-users
FWIW, seeing this too.  Also, when I boiled the project down to a macOS command 
line and run the “leaks" cli I don’t see the leak. 樂  

Ray

> On Oct 14, 2016, at 9:42 AM, Chris Chirogene via swift-users 
>  wrote:
> 
> Xcode8 is showing a memory leak in instruments and the memory graph. I have 
> narrowed it down to this: deriving from NSObject produces a leak indication. 
> I have no idea why.
> I need an NSObject to later use the @objc directive.
> The Test instance stored in the mDict Dictionary is indicated as a leak in 
> Xcode.
> This is running as an iOS Single-View-Application project in the iPhone5s 
> Simulator running iOS10.0
> Here is the sample code:
> 
>import Foundation
> 
>class Test: NSObject  // <-- derived from NSObject produces leak 
> indication below
>{
>static var cTest: Test! = nil
>var mDict: [String : Test] = Dictionary()
> 
>static func test() -> Void {
>cTest = Test()
>cTest.mDict["test"] = Test() // <-- alleged leak
>}
>}
> 
>class Test  // <-- NOT derived from NSObject, NO leak indication
>{
>static var cTest: Test! = nil
>var mDict: [String : Test] = Dictionary()
> 
>static func test() -> Void {
>cTest = Test()
>cTest.mDict["test"] = Test() // <-- NO leak
>}
>}
> 
>// from AppDelegate didFinishLaunchingWithOptions
>// ...
>Test.test()
>// ...
> 
> ___
> swift-users mailing list
> swift-users@swift.org
> https://lists.swift.org/mailman/listinfo/swift-users

___
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users


[swift-users] Memory Leak Indicated when Derived from NSObject

2016-10-14 Thread Chris Chirogene via swift-users
Xcode8 is showing a memory leak in instruments and the memory graph. I have 
narrowed it down to this: deriving from NSObject produces a leak indication. I 
have no idea why.
I need an NSObject to later use the @objc directive.
The Test instance stored in the mDict Dictionary is indicated as a leak in 
Xcode.
This is running as an iOS Single-View-Application project in the iPhone5s 
Simulator running iOS10.0
Here is the sample code:
 
import Foundation

class Test: NSObject  // <-- derived from NSObject produces leak indication 
below
{
static var cTest: Test! = nil
var mDict: [String : Test] = Dictionary()

static func test() -> Void {
cTest = Test()
cTest.mDict["test"] = Test() // <-- alleged leak
}
}

class Test  // <-- NOT derived from NSObject, NO leak indication
{
static var cTest: Test! = nil
var mDict: [String : Test] = Dictionary()

static func test() -> Void {
cTest = Test()
cTest.mDict["test"] = Test() // <-- NO leak
}
}

// from AppDelegate didFinishLaunchingWithOptions
// ...
Test.test()
// ...

___
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users