Closed gxl2024595 closed 6 years ago
You can use Instruments with the Allocations instrument to find out exactly where that extra 10MB comes from.
I had use Instruments to find out where that 10MB ,but i finally cannot find it .I had some screenshots.
when call this function ,the memory will increase,and when i dismiss the cameracontroller ,the extra 10MB would not be released
Could you try to add a viewcontroller in your demo(MobileNets) ,and you can present the cameratroller and dismiss the cameratroller for sereval times.You will find the same issues.Please help me Great God^^
It's definitely not a good idea to create the neural network every time. Just create it once and keep re-using it.
But,if i want to swich the training model ,i have to create the neural network again.Is there any way to swich the training model without creating the neural network again?
At this point, no. There is no way to change the weights after you've created the model. So in that case you do have to create the neural network again.
Ok, i get it.Thanks.
@gxl2024595 I fixed the memory leak. Give it a try and see if it works for you.
Thank you,the memory leak is fixed.Thank you for your help!!
i add a viewcontroller which as the first vc in MobileNetsDemo.Then present the cameracontroller in demo ,and then dismiss the cameracontroller .But i find that when i do this ,there is about 10M memory is not released.And everytime i present the cameracontroller ,there is more 10M in memory which is not released. i guess the issues is everytime createNeuralNetwork the memory will in increase,but i cannot solve the problem.How could i solve this problem??