Giter Site home page Giter Site logo

Comments (4)

VivekVithlani avatar VivekVithlani commented on June 19, 2024 1

I have also this issue in here map ios SDK.

Please check my this screenshot (this is device memory usage, not a simulator),

Screenshot 2019-10-16 at 2 52 42 PM

from here-ios-sdk-examples.

VivekVithlani avatar VivekVithlani commented on June 19, 2024 1

Finally, I found the solution for Crazy memory consumption

I am using 3 maps (HereMap) screen in my application and this solution works for me and Release memory around 100MB.

You need to init your map in viewDidAppear and remove your map in viewDidDisappear.

I am using 3 maps in my application and init view in

https://stackoverflow.com/questions/47043275/memory-pressure-with-here-maps-ios

-(void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];
    dispatch_async(dispatch_get_main_queue(), ^{
        if (self->mapView == nil) {
            self->mapView = [[NMAMapView alloc] initWithFrame:self.view.frame];
            [self.view addSubview:self->mapView];
            [self.view sendSubviewToBack:self->mapView];
        }
        [self mapSetup];
    });
}


- (void)viewDidDisappear:(BOOL)animated {
    [super viewDidDisappear:animated];
    [self removeMemoryForMapView];
}


-(void)removeMemoryForMapView {

    mapView.positionIndicator.visible = false;
    mapView.landmarksVisible = false;
    mapView.delegate = nil;
    mapView.gestureDelegate = nil;
    mapView.safetySpotsVisible = false;
    [mapView setVisibility:false forPoiCategory:NMAMapPoiCategoryAll];
    [mapView removeFromSuperview];
    mapView = nil;
}

from here-ios-sdk-examples.

AmbroseLi avatar AmbroseLi commented on June 19, 2024

Each instance of the map will incur more memory usage. However, sharing a map instance across multiple views is possible and something you should consider if the map configuration isn't too different across the various views. If they differ a lot (or if you are displaying traffic which should really only be displayed on one map view at a time to have a reliable display), then making the multiple map instances is the way to go. It's a matter of balance between convenience and memory usage.

On an aside, please post questions at our Stack Overflow forum where the HERE SDK user community and our SDK developers can help you.

from here-ios-sdk-examples.

sairasamdanii avatar sairasamdanii commented on June 19, 2024

@AmbroseLi Hi Ambrose, I have already posted this on Stack Overflow. But I was not able to post it on this page or under this tag. I could only find a tag named here-api on Stack Overflow. Can you help me adding this question to your page.

Below is the link of my post on Stack Overflow.
[https://stackoverflow.com/questions/47043275/memory-pressure-with-here-maps-ios]

Nature of my app is like this that having one single instance of map might not be possible. App has a tabbar and 3 of my tabs show map simultaneously.

Another bigger issues is that each time frame of map is changed, it reloads and memory keeps on increasing like any thing. Even moving the map and zoom in/ zoom out will also increase memory exponentially.

50 MB of memory on one load. Isn't it crazy.

Any help will be highly appreciated.

from here-ios-sdk-examples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.