Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-24389] : iOS Appcelerator Titanium App Crashes after some usage time #8853

Merged
merged 5 commits into from Mar 7, 2017

Conversation

vijaysingh-axway
Copy link
Contributor

Copy link
Collaborator

@hansemannn hansemannn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My use-cases worked, although I'm still curious why the app would cause because of a memory issue without calling the didReceiveMemoryWarning: before, which would be a much better place for this method.

[self sendPickerSuccess:dictionary];

#ifndef TI_USE_KROLL_THREAD
//TIMOB-24389 : iOS: Appcelerator Titanium App Crashes after some usage time
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Describe the issue rather then paste the ticket title. That will help others to get the details more quickly

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrote small note about problem. In ticket I think most of the things are explained.

//TIMOB-24389 : iOS: Appcelerator Titanium App Crashes after some usage time
KrollContext *krollContext = [self.pageContext krollContext];
[krollContext forceGarbageCollectNow];
#endif
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move this to dispatchCallback: instead, so it's ensured to be called for video capturing & editing as well? Or do you see down-sides there?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No side effect. Moved to dispatchCallback.

@@ -1441,6 +1441,9 @@ -(void)sendPickerSuccess:(id)event
[NSThread detachNewThreadSelector:@selector(dispatchCallback:) toTarget:self withObject:[NSArray arrayWithObjects:@"success",event,listener,nil]];
#else
[self dispatchCallback:@[@"success",event,listener]];
//TIMOB-24389 : As memory flushing was taking more time, so memory was growing continuously causing crash of app.
KrollContext *krollContext = [self.pageContext krollContext];
[krollContext forceGarbageCollectNow];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still only executed in sendPickerSuccess. The method saveCompletedForImage: and others create a blob as well, are there no leaks there? And change the comment to this:

// TIMOB-24389: Force the heap to be GC'd to avoid Ti.Blob references to be dumped.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch dude. Made changes.

@hansemannn
Copy link
Collaborator

LGTM, CR approved!

@hansemannn hansemannn added this to the 6.1.0 milestone Mar 2, 2017
@ewieberappc ewieberappc self-requested a review March 7, 2017 21:01
Copy link
Contributor

@ewieberappc ewieberappc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FR passed, using:
MacOS 10.12 (16A323)
Studio 4.8.1.201612050850
Ti SDK 6.1.0
Appc NPM 4.2.8
Appc CLI 6.1.0
Alloy 1.9.5
Xcode 8.2.1 (8C1002)

Tested using the provided sample code by taking over 50 pictures in the app, built with main-thread enabled and disabled. No crash was encountered unless JScore was also enabled. This will be addressed by another ticket/PR.

@ewieberappc ewieberappc merged commit e1d15b6 into tidev:master Mar 7, 2017
@hansemannn
Copy link
Collaborator

@vijaysingh-axway Can you do the 6.0.x backport? Will check tomorrow morning Europe time then. Thx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants