- Home /
What does Mprotect remapping failed mean and how do I fix it?
Hey guys!
I'm stumped with an error I found and from my searches, only a few have also received it a long time ago and I'm not quite sure if / how a solution was achieved.
The error I'm getting in xcode is
Mprotect failed at 0xed50000 (length 212992) with errno 12
Mprotect remapping failed
The game works fine in the editor and all other platforms. This error is iOS specific and happens every session that goes past the login process (loads another scene) for > 10 seconds. The exact time is inconsistent. I say inconsistently because it doesn't seem to happen right after an interaction. My game does download data and images so my hunch (and a lousy hunch at that) is threading / wait time is the cause of the inconsistently.
Here's some of my search results
http://forum.unity3d.com/threads/mprotect-failed-at-0x51fa000.15858/
-this is from all the way back from 2008 and it looked like it was a hotfixed by Unity
http://forum.unity3d.com/threads/mprotect-remapping-failed.15443/
-this is more of the same but a Unity dev did mention:
Workaround: don't allocate mono objects too frequently, reuse them if possible (this would also improve your performance).
-This is a little embarrassing since I'm a self taught Unity user but what exactly does that mean and can I apply it to my problem?
My system info:
Currently on Unity 5.3 but has been happening since 5.2 Xcode is version 7.2 but has been happening since 7.0 I think My game is 2d, it uses NGUI, it downloads data and images from the internet.
Thank you so much for your read and time. Hope you can help!
are you using ngui, parse, of the facebook sdk?
Basically, ins$$anonymous$$d of calling Destroy(GameObject) you disable it and place it into some 'pool' (attach to GameObject "ObjectPool" for example) and then ins$$anonymous$$d of Instantiate(...) you get that object from 'pool', set it to state you need and activate. You can Google for "Unity object pooling", I think I've seen some code samples. As of what I see it's either Unity bug with permissions setting on iOS, or exactly what that workaround mentiones: iOS has problems with setting permissions to a lot of new memory allocated. Also, in theory, it's possible you just don't have enough memory (check profiler's memory usage and iOS memory limit for applications. Are you Destroying(or pooling and checking if you didn't pool too much as that will hog memory) objects you don't need?). It's also possible that unity allocates too often during download causing that exact problem you written workaround for - that would be Unity bug. Posted as comment as I've never tested that myself and might be horribly wrong.I'm a self taught Unity user but what exactly does that mean and can I apply it to my problem?
Answer by guoyuan · Apr 20, 2016 at 02:12 PM
I have resolved this proble .平时都是我们看英文,现在你们看下中文吧。 出现的原因就是某个大型系统采用了大量的文件销毁和创建工作,比如同步切换场景。 解决方案: 1.改为异步才操作 2.改为分布来操作。2者原理差不多 就是以前一帧要处理完的事情 我分批次 去处理。结合协成来操作。
Google translate: We usually look at us in English, Chinese and now you look at it. The reason is that a large-scale system with a large number of document destruction and creation tasks, such as simultaneous switching scenes. Solution: 1. 2. to asynchronous operation only to distribution operations. 2 person principle is almost a thing to be finished before I processed in batches to deal with. Hiap Seng combined to operate.
Your answer
Follow this Question
Related Questions
iphone like date pickers 1 Answer
I can run the Unity3D Game through XCode, but can't run it directly through iPad. 3 Answers
Error linker IOS / Unity - XcODE 2 Answers
Xcode build crashes 0 Answers
Unity modules for iOS? 1 Answer