Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
4
Question by Murcho · Jun 06, 2010 at 01:48 PM · iphonexcodememory-leaktool

Does XCode Instruments -> Leaks give correct information with Unity iPhone?

I'm pretty new to Unity iPhone, however I've spent about a year and a half developing in Unity, so I've been spending some time familiarising myself with the production line and testing of a few thing before going into full production on a project, and have found that anything I build from Unity iPhone 1.7 reports memory leaks through the XCode Instruments Leaks tool. I first tried it on a test app I had put together, and after seeing the leaks appear in that, I decided to make a plain app with one scene, and one camera in it. This also produced leaks, in just about every build configuration I could try, on both a 1st Gen iPod Touch and a 3rd Gen iPod Touch, in ARM 6 and ARM 7 build configurations.

I started doing some searches to determine if this was a major issue, and from what I've found there were some leaks in earlier versions of Unity iPhone, however I haven't seen anything reported specifically for Unity iPhone 1.7. I did come across one post on the forums stating that the reports from Leaks was inaccurate because it interpreted the Mono runtime's handling of memory incorrectly, however it was a unique post, and didn't really explain why.

So are the memory leaks being reported from Instruments Leaks real leaks, or is there a different way I should be profiling my apps to make sure there aren't any memory leaks?

Edit: I really need to know this, and I'm pretty sure that due to Apple's stringent approval process, that everyone does, so a bounty has been placed.

Edit 2: As I haven't received a response from Unity Support, I'm selecting the answer that gave the most useful response. I will post any further findings here once Unity get back to me.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
4
Best Answer

Answer by Mike 3 · Jun 09, 2010 at 10:58 AM

The best way to make sure your app doesn't have leaks will be to watch your memory usage over time, to see if it steadily goes up.

There are many ways to create leaks with unity, most of them being to do with creating certain types of objects (e.g. Texture2D) which actually reside in native memory.

If those are leaking, you probably won't see them in leaks either - they're still in use by unity internally, you're just not using them for something. You will however see the memory steadily creep up over time.

If your app stays stable memory wise, and the only leaks are the false positives from Unity, Apple won't fail your app for memory reasons

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Cyclops · Jun 09, 2010 at 01:30 PM 0
Share

Wouldn't depend on how you test the game? If your play-testing coverage isn't exhaustive (and whose is? :) - you could miss any special cases that leak memory. In general, I like the idea of static code checkers (although I know nothing about XCode specifically, or the iPhone).

avatar image Mike 3 · Jun 10, 2010 at 12:47 AM 0
Share

Indeed - I wasn't implying that he should stop using Leaks, just to do a lot of playtesting on top of that to make sure

avatar image Murcho · Jun 10, 2010 at 05:50 AM 0
Share

Thanks, I understand how $$anonymous$$ono/.NET handles memory, and I'm aware of the fact $$anonymous$$ono's garbage collector isn't up to par, but my concern is mainly if Leaks is useless for tracking memory. If so, what other methods people are using to monitor memory leaks. I'll be posting Unity Support response once it comes through so may have some more info then.

avatar image
0

Answer by Ashkan_gc · Jun 08, 2010 at 05:59 PM

you will not have any problems for your app to being aproved because there are many many unity based games there in ITunes. Mono's garbage collector is not a great multi generation one like what you see in .NET framework or java. the main unity engine has no leaks i think but i can not be sure. so the leaks are not real leaks and mono will collect them soon after they appear. you can call GC.Collect at any time to collect garbages.

Comment
Add comment · Show 6 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Murcho · Jun 09, 2010 at 06:02 AM 0
Share

$$anonymous$$any great Unity games have been approved under the OLD T.O.S. and this is a perfect example of why middleware shouldn't be used, as the developers aren't aware of what is happening on the device. I can't be sure on if they're real leaks, and as a result I can't be sure that Unity will remain a usable platform.
If there is a major lockdown on apps under the new T.O.S. I don't want to give Apple any reason to stop our app from being released. This is a major issue in my eyes

avatar image Ashkan_gc · Jun 09, 2010 at 07:07 AM 2
Share

email UT suport and they will provide you with the most accurate info about it or even email the iphone developers of UT directly. they are friendly enough to answer.

avatar image Murcho · Jun 10, 2010 at 05:48 AM 0
Share

I've emailed Unity Support, so I'll post the result of that once it's up.

avatar image Cyclops · Jun 10, 2010 at 03:32 PM 0
Share

"middleware shouldn't be used" - @$$anonymous$$urcho, if I could downvote comments, I would that one - Unity is middleware, so you're basically saying Unity shouldn't be used. Everyone should just code in the C language. Which would mean 10X the effort expended to do any kind of complex game.

avatar image Murcho · Jun 11, 2010 at 12:35 AM 0
Share

This is the argument of TOS 3.3.1, that middleware can't be used, and this is a perfect example of why Apple have 3.3.1, because people are releasing software on the device that can be detrimental to the device, and they have no idea why it is detrimental because they spend little to no time in XCode/Obj C, don't understand the SD$$anonymous$$, the Human Interface Guidelines, or how the underlying hardware works. I'm not saying the Unity shouldn't be used, but there is an expectation that the developer understand the SD$$anonymous$$, this is an example of people not understanding the SD$$anonymous$$.

Show more comments

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

Unity modules for iOS? 1 Answer

Debugging NullReferenceExceptions in iOS Games 2 Answers

Replace Graphics with inserted picture 0 Answers

clang: error: linker command failed with exit code 1 (use -v to see invocation) 0 Answers

Xcode build crashes 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges