Memory performance difference between Activity Monitor and Instruments - xcode

My xcode project uses OpenGL 3.2 to draw. When running the profiler the allocation instruments shows a healthy behaviour (allocating and deallocating) but when observing the Activity Monitor the memory usage rises rapidly to ~ 2GB in 3 mins. I run the same program on other macs and the Activity Monitor shows only a 40MB memory usage. I run the same project on the same OS version 10.8 and same Xcode version 4.4.

Related

Single thread consumes > 100% CPU usage, according to XCode Instruments Profiler?

I profiled an app (Mac OS) using CPU Profiler, part of the XCode Instruments tools.
I expect that each thread (of my process) can at the most consume 100% CPU usage. It cannot consume more than 100% of a hyperthread/core, since a thread can only ever run on a single core at a time, not two.
However, I am surprised to see ~290% CPU usage reported for a thread in the XCode CPU Profiler!
This makes me take a step back and wonder -
What is the unit of the CPU usage shown in the "timeline" view for a thread in the XCode profiler?
What does a value over 100 (for a single thread) indicate?
See this example screenshot from XCode Instruments' CPU Profiler, showing a single thread:

Can Xcode utilize 64GB RAM or greater?

I have a MBP with 16GB of RAM. As projects grow in Xcode, the compile time does take longer. I'm looking into starting a hackintosh project purely for shortening Xcode compilation time. Since RAM is cheap, I wanna push the normal boundaries. But the biggest question is will Xcode be capable of using all the RAM greater than 32GB? I know there will be some diminishing marginal returns at some point of RAM increase.
RAM usage is mostly governed by the OS, because the Mac Pro does support up to 64GB of RAM, so should OSX (and by extension XCode).
Although I wonder if your compile time issues are actually RAM-related. I have Xcode projects that take minutes to build and it's all because my CPU is pegged at 100% (using a mid-2015 15" retina MBP). Not many software projects are RAM-constrained past 16GB.

Xcode 6 swift sample app memory usage

I'm just starting to learn swift for the first time and I was running the sample spritekit project that comes with xcode 6 when you start a new game, the hello world app with a little spaceship spinning when you tap. When the app is executed in the ios simulator I can see the memory usage on xcode. The memory was about 56MB just for the hello world app. Is there any reason is using so much memory? or is this a normal amount of memory for such apps?
I assume you are running it in the simulator, which will have different memory usage characteristics than running it on an actual device. You'll also have slightly different memory usage when running it in debug vs running it in release mode. In other words, I wouldn't pay too much attention to the memory usage when running debug in a simulator.

mac osx occupied memory increase quickly

I noticed when I run Xcode especially start to run Interface builder.
Mac osx occupied memory increased quickly.
Not only xcode, there are some other apps also cause memory occupy too much after running a while.
Even the memory of my mac is 4GB, some time I have to use tool to free memory.
What is reason and how to avoid this case happen in my developing mac app?
Welcome any comment
I just experienced something similar(but probably not the same) in my Qt application.
I was reading and checksumming lots of files and the free memory kept dropping, though my appliations "real memory" stayed at a steady 50ish MB. However the amount of "Inactive memory" kept climbing.
What was happening was that every file i read was being added to the disk cache. The memory consumed by the disk cache is apperantly marked as "inactive", which should be just as availible as "free" memory according to apple ( http://support.apple.com/kb/HT1342 ) but that didn't stop OSX from starting to swap when "free" hit below 50ish MB.
in C:
#include "fnctl.h"
fcntl(f.handle(),F_GLOBAL_NOCACHE,1);
Seemd to fix that by bypassing disk caching for that file descriptor.
Freeing up inactive memory ( if that is indeed your problem ) can also be done from the commandline using the "purge" command.

Using Memory Monitor on a single process on Instruments on OS X?

I'm having some issues with Instruments on OS X. I'm trying to monitor the memory consumption of a single process over time on OS X. I'm using Instruments 4.1 for that, with the "Memory Monitor" instrument.
On the Official Instruments Documentation, Apple states that "This instrument [Memory Monitor] can operate on a single process or on all processes currently running on the system." However, even when I set the current target to a specific process, it seems to monitor all the processes on the machine.
Here's a screenshot of my current setup:
Am I doing something wrong? How can I get Instruments to monitor the memory consumption of a single process?
Thanks in advance.
I don't think you're doing anything wrong. In my experience the various Monitor instruments monitor all processes even if you tell them to monitor only one application.
If you want to monitor your application's memory consumption, use the Allocations instrument. The Live Bytes column for the All Allocations category will tell you how much memory your application is using.

Resources