i have a scene in my Unity project with 2 2D skinned and animated character. (and some others things...)
When i build in release, the scene take on pc around 500 MB. (all inclusive)
When i launch debug in unity, Unity take 10 GB more memory... (so my computer is nearly memory empty and crash often...)
If i remove that 2 characters, the memory usage for debugging is more "normal".
Is it normal that just with that 2 characters it take so much memory ?
I have less issue with previous version of unity (i'm using Unity 5.6.1f1)
I found out that it was the profiler that is using that huge memory size.
I remove the profiler recording and memory keep under 1.5G in unity / debug and it's clearly better.
But i don't know why the profiler use so much memory in that scene....
Related
I've been working on Environment Designing in unreal engine 3 for a long time, and i want to shift to unreal engine 4 now.
My aim is to create an environment, in which every texture will be 4K and uncompressed, plus the dynamic reflections and all the photo realism effects with 4K in-game Resolution and should run on about 120 frames/sec.
I just want to test the capabilities of the engine, so, I want to know the specifications of a rig that will be needed to process and develop all this with ease.
All help will be highly appreciated.
Thank you.!
There is no game with 4K texture works 120fps , and as far as I know, unreal engine doesnt support SLI by default .
However, if you have GTX 1080 with Decent i7 cpu , you can hit around 80-45fps depends on how heavy is your scene .
you can develop on GTX 1070 , and it run pretty ok , however, I dont know how far u will do , I work with GTX 1070 , and its too smooth for everything . you need more GPU memory , so never sacrifice with GPU for other things costs
After upgrading to Xcode 7 with Swift 2, my Sprite Kit project is very laggy on the simulator.
It previously would get 60 fps, and now it maxes out at 15 fps. (If I remove all textures, it goes up to 60, but even adding a single screen-sized texture drops it all the way down to 15 again.)
I've tried running in release mode as well as debug, and it makes no difference.
It's still smooth on the device.
Has anybody else had this issue? Any fixes? It just makes it hard to test.
The simulator will almost always have lag due to the fact that your computer is emulating the device (so yes I have had your issue). It is not really a problem with your App (unless you changed something massive in your App during the upgrade). I cannot speak to why the frame rate dropped on the sim from the upgrade (probably something not optimized yet, plus more features in iOS 9 slowing down the sim), but as long as it is good on the device, you should be good.
If you elaborate on what your setup is (what device(s) you have, and computer hardware), and what you are releasing to, I can provide more accurate information.
Another thing that may help is restarting the computer, that always seems to help when Xcode gets funny.
I am updating app to make it compatible with IOS 6, getting memory warning. live bytes in instrument shows low usage (2.3 MB). In VM tracker dirty size gets around 50%. in VM Tracker type = CG Image -> dirty size increases to 100%. My app requires users to take pictures but i am not using any core graphics objects. is there a way to release CG Image dirty memory ? thank you for taking time and reviewing my request.
My app using ARC starting leaking memory very badly on iOS6 whilst it ran perfectly on iOS5. When I say "leaking", I actually mean allocating memory and then not releasing the memory properly when I removed objects from mutable arrays, causing the app's memory usage to increase dramatically.
After lots of frustration, I've managed to fix it by setting up an #autoreleasepool { ... } around the offending section.
My suspicion is that iOS6 is threading my app differently compared with iOS5, as there used to be an #autorelease pool covering that process.
I suggest you try that solution as it is very quick to implement.
I am working on an iPhone game which receives memory warning that I am not experienced enough to interpret. I have been watching some iTunesU tutorial but I am still not very good at this..
I have received various memory leaks whilst running my game and I wanted to understand how to interpret the stack trace show in Instruments properly.
I attach a screenshot of the ObjectAllocation instrument output . Even when I zoom filter I don't manage to filter the data in the ObjectSummary .
The peaks in memory usage in 1 happen when the GameScene is initialized and all the data is loaded (ParallaxBackground, CCSpriteBatchNode) and Sprites and bullets frames are created (in an CCArray of spriteFrames).
The big blue peak is just at load time but the app freezes and then crashes only after a while and from the graph I see that the memory usage (blue bar) has gone down.. so I don't quiet get that. Also, whenver I try to use the leaks instrument the App crashes..
I know is a very silly question for someone experienced, but I just need some extra help getting started with this toolset.
I think the memory problem are due to the sprites I allocate in sprite cache classes, but I am not sure on this and hence wanted to investigate this using Instruments but can't find out how to see what is the object causing the memory warning and how to access the stack trace..
PS: I am running on an iPod 4th generatio and I am using Cocos2D as library
EDIT: I do not also understand why if the Live Bytes are only 1.01 MB the App crashes and why I still receive a memory warning (see black flags). Is it due to some pointer referencing to some null variable or due to an excessive memory allocation? 1.01 MB doesn't seem much to me..
EDIT 2: Following Marion's advice I used the Activity Monitor and realized that the effective real memory usage is 55.39 MB. I misinterpreted the "live bytes" word. I will try to dig into this further and will leave the question as unaccepted for now to allow other people contribute. If I won't have any other answer within one-two days I'll mark as accepted the current answer. Thanks!
Thanks a lot!
If you want to find leaks, use Leaks instrument instead of Allocations. To find out, how much memory use at the moment, use ActivityMonitor.
If you will have problems with memory in cocos2d, you can try to purge cache. In cocos2d you can purge CCTextureCache, CCSpriteFrameCache, CCAnimationCache. It will release unused textures and frames.
If you want to check if all of unnessesary textures were removed from memory, you can place breakpoint to CCTextureCache class and call, for example, sharedTextureCache and look throw the content of textures_ dictionary. Or add some method to this class to be able to dump current state of cache.
For the last few weeks I've been tearing my hair out trying to get a tiling mechanism working on an iPhone. I need to scale and crop images of about 150mb so that they can be saved as tiles that will be requested by a scroll view, allowing the user to see the image in high resolution.
The problem is that these images are really pushing the bounds of what an iPhone can handle. It seems quite easy to scale these huge images down to 1000 or so across and do that tiling, but for large zoom levels I need to scale it mid-way, say 4000 across and that's too big. So I hit upon the idea of making medium sized blocks from the full sized image and tiling each of those and the medium zoom.
By creating an autoreleasepool around the inner loops, and draining it after each cycle I can mostly keep the memory under control but sometimes, and to me it seems random, memory is getting leaked, or at least not drained. I'm doing all this on a secondary thread and when it gets back to the first function in that thread I release the thread's own autoreleasepool and only then do the last memory artifacts get cleared. It doesn't seem to bother the simulator but the iPhone is much less forgiving and it crashes before it can complete the whole tiling process. The cropping code I am using is from Hive05
http://www.hive05.com/2008/11/crop-an-image-using-the-iphone-sdk/
Has anyone else had to deal with such massive images before? Is pre-generating tiles the best way to go? Any suggestions on why some loops would increase the memory and some not, or how to force every auto-released thing to clear on the inner pool instead of waiting for the outer pool?
Thanks for reading this far.
for got to add, these images are TIFs, so perhaps a direct reading of the bitmap info would be better than scaling and cropping the entire thing
First of all, I have serious doubts that an 150 MB image would fit in the device's memory, even if we're talking about a 3GS. That one has about 128 MB available memory for 3rd party apps maximum. See the device console messages and look for memory warnings, I guess you'll see that before crashing, the app emits them when trying to load your image. Reading the bitmap info in chunks would seem more sensible, as you'll be managing smaller sections at a time. I don't think Cocoa has a random-access file API, so you'll have to resort to a C function.
I've managed to write the loops that cycle through tiles of 1024x1024 and my iPhone 3G is able to finish the processing. It takes over 30 minutes though so it isn't great but that's what you get for working with 150mb TIF on a cellphone.
To keep the memory usage low I had to drain the AutoReleasepools after each iteration. Apple Tech Support pointed out that since the iPhone is a reference-counted environment rather than a garbage collected environment it is better to create a new AutoReleasePool at the start of each inner loop and drain it at the end of each loop than to create it before any loops start, drain it many times and then release it after the loops are done. Until I made that change my app would crash an iPhone but run fine on the simulator.