delyntaxUG / core-plot

Automatically exported from code.google.com/p/core-plot
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

iOS Core Plot: backboardd[26] <Error>: CoreAnimation: failed to map #580

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I have a problem with Core Plot on a iPad App that I've developed. My entire 
app uses ARC.

My app as 9 viewControllers, in each viewcontroller there is a Core Plot graph 
with 2 or 3 scatter plots.

After iterating those views for 8 or 9 times (back and forward) some graphs 
disappears and the error log of the iPad shows the following:

Sep  7 18:12:24 Mio-iPad backboardd[26] <Error>: CoreAnimation: failed to map 
2263232 bytes (3)
Sep  7 18:12:24 Mio-iPad backboardd[26] <Error>: CoreAnimation: missing mask 
layer 0x0
Sep  7 18:12:24 Mio-iPad backboardd[26] <Error>: CoreAnimation: serialization 
error from context 1173490153
Sep  7 18:12:24 Mio-iPad backboardd[26] <Error>: CoreAnimation: rendering error 
506
Sep  7 18:12:25 Mio-iPad backboardd[26] <Error>: CoreAnimation: rendering error 
506
Sep  7 18:12:25 Mio-iPad backboardd[26] <Error>: CoreAnimation: failed to map 
2263232 bytes (3)
Sep  7 18:12:25 Mio-iPad backboardd[26] <Error>: CoreAnimation: missing mask 
layer 0x0
Sep  7 18:12:25 Mio-iPad backboardd[26] <Error>: CoreAnimation: serialization 
error from context 1173490153
Sep  7 18:12:25 Mio-iPad backboardd[26] <Error>: CoreAnimation: rendering error 
506
Sep  7 18:12:25 Mio-iPad backboardd[26] <Error>: CoreAnimation: rendering error 
506
Sep  7 18:12:25 Mio-iPad backboardd[26] <Error>: CoreAnimation: rendering error 
506
Sep  7 18:12:25 Mio-iPad backboardd[26] <Error>: CoreAnimation: rendering error 
506
Sep  7 18:12:25 Mio-iPad backboardd[26] <Error>: CoreAnimation: rendering error 
506
Sep  7 18:12:25 Mio-iPad backboardd[26] <Error>: CoreAnimation: rendering error 
506
Sep  7 18:12:25 Mio-iPad backboardd[26] <Error>: CoreAnimation: rendering error 
506
Sep  7 18:12:25 Mio-iPad backboardd[26] <Error>: CoreAnimation: rendering error 
506
Sep  7 18:12:25 Mio-iPad backboardd[26] <Error>: CoreAnimation: rendering error 
506
Sep  7 18:12:25 Mio-iPad backboardd[26] <Error>: CoreAnimation: rendering error 
506
Sep  7 18:12:25 Mio-iPad backboardd[26] <Error>: CoreAnimation: rendering error 
506
Sep  7 18:12:25 Mio-iPad backboardd[26] <Error>: CoreAnimation: rendering error 
506

I tried to investigate leaks and other instruments without findig a 
resolution...

Has anyone an answer or suggestion on this problem?

Thanks in advice

Original issue reported on code.google.com by vasco.al...@gmail.com on 7 Sep 2013 at 4:27

GoogleCodeExporter commented 8 years ago
I suspect you're running out of memory. Does your app get a memory warning 
before graphs disappear? If this is the problem, you'll need to release (remove 
any strong references) the graphs that are offscreen to free up memory.

Original comment by eskr...@mac.com on 7 Sep 2013 at 8:03

GoogleCodeExporter commented 8 years ago
I've made a test and no, I'm not getting any memory warning 
(didReceiveMemoryWarning) before the graphs disappears.
I've used also the Allocation instrument but the trend doesn't grow up during 
the iterations.

The strange thing is also:
If I run the app in this way:
view1 --> view2 --> view3 --> view4 --> view5 --> view6 --> view7
the graphs doesn't disappear (after 200 iterations).

If I run the app in this way:
view1 --> view2 --> view3 --> view4 --> view5 --> view6 --> view7 --> view8
the graphs disappear after 49 iterations

If I run the app in this way:
view1 --> view2 --> view3 --> view4 --> view5 --> view6 --> view7 --> view8 --> 
last view
the graphs disappear after 7 iterations.

Is also interesting to know that:
view3 and view6, view4 and view7, view5 and view8 are specular (they are two 
classes presenting the same graphs with only different variables)

This is the way I've created the dealloc method (since I'm using ARC), are 
there any issues?

-(void)dealloc
{    
    touchPlotBall = nil; //(CPTScatterPlot)
    dataSourceLinePlot= nil; //(CPTScatterPlot)
    dataSourceSLinePlot = nil; //(CPTScatterPlot)

    [scatterPlotViewValue removeFromSuperview];  //(CPTGraphHostingView)
    scatterPlotViewValue=nil; //(CPTGraphHostingView)

    [scatterPlotViewBall removeFromSuperview]; //(CPTGraphHostingView)
    scatterPlotViewBall=nil; //(CPTGraphHostingView)

    [self.dataForPlot removeAllObjects]; //(NSMutableArray)
    self.dataForPlot = nil; //(NSMutableArray)

    [self.dataForPlot1 removeAllObjects]; //(NSMutableArray)
    self.dataForPlot1 = nil; //(NSMutableArray)

    [contentArray removeAllObjects]; //(NSMutableArray)
    contentArray = nil; //(NSMutableArray)

    [contentArray1 removeAllObjects]; //(NSMutableArray)
    contentArray1 = nil; //(NSMutableArray)

    [generalStockData removeAllObjects]; //(NSMutableArray)
    generalStockData = nil; //(NSMutableArray)

    [periodStockData removeAllObjects]; //(NSMutableArray)
    periodStockData = nil; //(NSMutableArray)

    [shortPeriodStockData removeAllObjects]; //(NSMutableArray)
    shortPeriodStockData = nil; //(NSMutableArray)

    self.startGraphValue=nil; //(NSDate)

    self.delegate = nil; //(id<view7ControllerDelegate> delegate;)

    self.fetchedResultsController = nil;
    self.managedObjectContext = nil;

    ballImage =nil;

}

Original comment by vasco.al...@gmail.com on 8 Sep 2013 at 8:04

GoogleCodeExporter commented 8 years ago
Typically, things that appear in dealloc under ARC are:
1.Properties whose data type is not an ObjectC object, like CGColor.
2.Any to-be-unregistered Observers. (from methods that begins with addObserver:)

ARC takes care much of the rest. Writing self.nameofProperty=nil for an 
NSMutablbeArray,
which is an ObjectC object in dealloc, suggest you do not understand ARC. 
Please consider slowing down and re-evaluate your memory management-fu.

Also, given your description without seeing your project source, it is not 
possible to even know
if this is a bug. Consider reducing the complexity of your project to be sure 
this is indeed a bug,
reproducible even in simple cases. 

Original comment by ytrfa...@gmail.com on 8 Sep 2013 at 8:52

GoogleCodeExporter commented 8 years ago
I'll do this changes and let you know. Actually you're right for the 
deallocation of NSMutableArray on ARC. 
But form you I needed to understand if something from CorePlot should be setted 
to nil or not during the deallocation. I have no strong references to any 
CorePlot object.

For the rest I'll do a test and let you know.

Original comment by vasco.al...@gmail.com on 8 Sep 2013 at 9:04

GoogleCodeExporter commented 8 years ago

Original comment by eskr...@mac.com on 11 Oct 2013 at 12:28

GoogleCodeExporter commented 8 years ago
Actually the problem was on my project.
Thanks for the support.

Original comment by vasco.al...@gmail.com on 11 Oct 2013 at 6:12