highcharts / highcharts-ios

iOS wrapper for Highcharts.
Other
127 stars 39 forks source link

Memory leaks, once again #416

Closed skuske closed 1 year ago

skuske commented 1 year ago

Create a simple test project with any kind of a HighChartView and you'll see these memory leaks in Xcode Instruments. It looks like

-[HIChartView setupWithFrame:]

leaks. Can you please investigate and offer a fix? Thanks!

leaks

leaks_1

leaks_2

leaks_3

leaks_4

ihnatmoisieiev commented 1 year ago

Hello @skuske, we will investigate it asap. Thank you!

ihnatmoisieiev commented 1 year ago

Hello @skuske, in the attachment, you can find a simple test project with a demo example from the readme. Any Xcode tool(Memory Graph, Instruments, Analyze) doesn't show any leaks.

Could you please provide more info about how to reproduce the leak step by step?

Thank you in advance.

MemoryCheck.zip

Screenshot 2023-04-23 at 13 25 02 Screenshot 2023-04-23 at 13 25 35 Screenshot 2023-04-23 at 13 26 06
skuske commented 1 year ago

@ihnatmoisieiev

I have attached a test project that shows the leaks:

HighCharts-LeakTest.zip

The zip file also contains a 'leaks.trace' file from instruments. Here are the screenshots showing the leaks:

leak_4 leak_3 leak_2 leak_1
ihnatmoisieiev commented 1 year ago

Hello @skuske, thanks for the additional info. I've reproduced it only on my physical device. As far as I noticed, leaks occurred in JavaScriptCore, not Highcharts iOS library. I'll report it to the core team and let you know.

ihnatmoisieiev commented 1 year ago

Hello @skuske,

I've reproduced the same behavior with the following simple code:

#import "ViewController.h"
#import <WebKit/WebKit.h>

@interface ViewController ()
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    WKWebView *webView = [[WKWebView alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height/2)];
}

@end

So, it means that it's not a Higcharts iOS or core Highcharts JS framework specific issue.

skuske commented 1 year ago

@ihnatmoisieiev

Thanks, I'll close the issue.