adamhartford / SwiftR

Swift client for SignalR (iOS and Mac)
MIT License
174 stars 74 forks source link

Memory Issue #90

Open Jhtang opened 7 years ago

Jhtang commented 7 years ago

Hi Adam, I have been using your wonderful SignalR Client for Mac to develop the Alert application running on Mac. For somehow, my program starts to have a memory leak issue after running it for a while. So far I still could not find out where did it come from even though I use the Xcode Leak tool.

Your advice is greatly appreciated.

Sincerely, Joseph

adamhartford commented 7 years ago

Are you using UIWebView or WKWebView?

Jhtang commented 7 years ago

Hi Adam,Thank you very much for your reply.I didn't use WebView.I did use the NSPopUp for displaying mesages.Sincerely,JosephOn May 7, 2017 12:46 PM, Adam Hartford notifications@github.com wrote:Are you using UIWebView or WKWebView?

—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or mute the thread.

adamhartford commented 7 years ago

I meant did you configure SwiftR to use WKWebView behind the scenes. It always uses a hidden web view. You would have code like this if you're using WKWebView:

// Client
let connection = SignalR("https://swiftr.azurewebsites.net")
connection.useWKWebView = true // <-- See here

The reason I ask is: UIWebView is known to leak memory. WKWebView is the better choice for SwiftR, but does have some limitations. See the README for more info there.

Jhtang commented 7 years ago

Thank you very much for your advice. I turned on useWKWebView for now, and I will test it to see if it still has the memory leak issue.

Sincerely, Joseph

Jhtang commented 7 years ago

I tried it on my iMac, it seems working fine. However, my colleague tried the app on his iMac and he got a lot of instances of app web content in the Activity Monitor. The app occupied a few GB memory.