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

Memory limit issue on iOS #64

Open
exentrich opened this issue Nov 9, 2017 · 6 comments
Open

Memory limit issue on iOS #64

exentrich opened this issue Nov 9, 2017 · 6 comments

Comments

@exentrich
Copy link

exentrich commented Nov 9, 2017

Thank you very much for this great library!

Right now i have only one issue. When i open and close extension, memory consumption only increase (double every time). After some reopens it crashes, because strict memory limits for extensions on iOS.
It's looks like when extension is closed it not freeing memory.

Maybe you have some ideas, how to force free memory?

@karlAlnebratt
Copy link

I concur, thanks for a great lib!

I'm experiencing the same issue.
I have followed the steps described in the README and created Separated bundles.
The app is built with release config.

And after opening the share extension three or four times it crashes.
Running on an iPhone 7 iOS 11.0.3

Please let us know if we can assist in any way.

@exentrich
Copy link
Author

exentrich commented Nov 20, 2017

I fixed this in weird way:
Just call some failing function in js. It will crash silently extension and release memory 👍

So solution is to crash extension :)

@karlAlnebratt
Copy link

@exentrich thanks for the idé 👍 I will implement this on my end until there is a patch for the memory issue

@danielsuo
Copy link

danielsuo commented Mar 9, 2018

@exentrich @karlAlnebratt hysterical. For future comers, I wound up modifying the close method to both crash and add an animation.

Don't forget to add rootView as a global variable (per the original comment in viewDidLoad).

RCT_EXPORT_METHOD(close) {
    dispatch_async(dispatch_get_main_queue(), ^{
        [UIView animateWithDuration:0.3
                         animations:^(void){
                             CGRect rect = rootView.frame;
                             rect.origin.y = 2 * rect.size.height;
                             rootView.frame = rect;
                         }
                         completion:^(BOOL finished){
                             [extensionContext completeRequestReturningItems:nil
                                                           completionHandler:nil];
                             @throw NSInternalInconsistencyException;
                         }];
    });
}

@chaitanyadeorukhkar
Copy link

Why isn't #64 (comment) in the repo? is there any proper way to close it without crashing it?

rbscott added a commit to rbscott/react-native-share-extension that referenced this issue Feb 8, 2019
@aschenkel
Copy link

Just call some failing function in js. It will crash silently extension and release memory 👍

hey @exentrich, its been a while. do u recall what u meant with this?

When I called a non-existing function or a throw an Error the extension crashes, not silently.

How could I call a failing js function to release memory and not make the extension crash?

Thanks in advance

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

No branches or pull requests

5 participants