Search Results

Search found 12417 results on 497 pages for 'memory leak'.

Page 19/497 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • virtual memory commited

    - by vinu
    After a server bounce happens, and after around 40-45 days time period, we receive continuous “Committed Virtual Memory” alerts which indicates the usage of swap space in the magnitude of 4GB This also causes the application to perform very slowly and experience a number of stalled transactions. Server Setup: 4 Tomcat Servers (version 7.0.22) that are load balanced (not clustered) by 2 Apache Servers. And the Apache servers themselves supply static content and routing to these 4 tomcat servers. Java Runtime Version: java version "1.6.0_30" Java(TM) SE Runtime Environment (build 1.6.0_30-b12) Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode Memory Startup Parameters: MEMORY_OPTIONS="-Xms1024m -Xmx1024m -Xss192k -XX:MaxGCPauseMillis=500 -XX:+HeapDumpOnOutOfMemoryError -XX:MaxPermSize=256m -XX:+CMSClassUnloadingEnabled" Monitoring – Wily monitoring is available in all the production servers that monitors key server parameters and sends out configurable alert emails based on pre defined settings. Note: Each of the servers also has two other separate tomcat domains that run different applications Investigated area: There is no Heap Memory Leak and the GC is running fine without any issues over any period of time The current busy thread count corresponds directly to the application usage – weekends and nights have lesser no. of threads compared to business hours ThreadLocal uses a WeakReference internally. If the ThreadLocal is not strongly referenced, it will be garbage-collected, even though various threads have values stored via that ThreadLocal. Additionally, ThreadLocal values are actually stored in the Thread; if a thread dies, all of the values associated with that thread through a ThreadLocal are collected. If you have a ThreadLocal as a final class member, that's a strong reference, and it cannot be collected until the class is unloaded. But this is how any class member works, and isn't considered a memory leak. The cited problem only comes into play when the value stored in a ThreadLocal strongly references that ThreadLocal—sort of a circular reference. In this case, the value (a SimpleDateFormat), has no backwards reference to the ThreadLocal. There's no memory leak in this code. Can anyone please let me know what could be the cause of this and what to be monitored?

    Read the article

  • SQL server peformance, virtual memory usage

    - by user45641
    Hello, I have a very large DB used mostly for analytics. The performance overall is very sluggish. I just noticed that when running the query below, the amount of virtual memory used greatly exceeds the amount of physical memory available. Currently, physical memory is 10GB (10238 MB) whereas the virtual memory returns significantly more - 8388607 MB. That seems really wrong, but I'm at a bit of a loss on how to proceed. USE [master]; GO select cpu_count , hyperthread_ratio , physical_memory_in_bytes / 1048576 as 'mem_MB' , virtual_memory_in_bytes / 1048576 as 'virtual_mem_MB' , max_workers_count , os_error_mode , os_priority_class from sys.dm_os_sys_info

    Read the article

  • How to get the installed Memory Type

    - by balexandre
    Windows 7 could be better at this, it tells everything about the computer CPU but only the Memory amount Microsoft should add information about DDR type, speed and maybe CL as well. While this never happens, What's the best and easy way to check the installed memory so we can buy and upgrade it? I was thinking a simple software so I don't need to install the full SiSoft Sandra for example, just looking for something small, only for the memory part.

    Read the article

  • Reducing apache VIRT and RES memory usage

    - by lisa
    On a quad-core server with 8GB of ram I have apache processes that use up to 2.3GB RES memory and 2.6GB VIRT memory. Here is a copy of the top -c command http://imgur.com/x8Lq9.png Is there a way to reduct the memory usage for these apache processes? These are my httpd.conf settings Timeout 160 TraceEnable Off ServerSignature Off ServerTokens ProductOnly FileETag None StartServers 6 <IfModule prefork.c> MinSpareServers 4 MaxSpareServers 16 </IfModule> ServerLimit 400 MaxClients 320 MaxRequestsPerChild 10000 KeepAlive On KeepAliveTimeout 4 MaxKeepAliveRequests 80

    Read the article

  • Reporting memory usage per process/program

    - by Nick Retallack
    How can I get the current memory usage (preferably in bytes so they can be added up accurately) for all running processes individually? Can I roll up the summaries for child processes into the process that spawned them? (e.g all apache threads together). Sometimes, my server runs out of memory and becomes unresponsive. I want to discover what is using up all the memory. Unfortunately, it's likely to not be a single process. Some programs spawn hundreds of processes, each using very little memory, but it adds up. On a side note, is it normal for apache to spawn 200+ processes?

    Read the article

  • Fresh install CentOS 6.4 64b with directadmin slowly consumes all memory and crashes

    - by Coen Ponsen
    Dear server fault community, This is my first question on server fault, i'm new to server (mis)configuration so please forgive me for asking something stupid :) I'm running Directadmin on a CentOS 6.4 64b with 4GB memory and over 10000Gh virtual machine. I migrated my websites because my former vps couldn't keep up anymore. Only half of the websites from this 1GB machine were migrated jet. So the migration is still in progress and already my server crashes every day. The server performance up until that moment is perfect. The directadmin log files show nothing out of the ordinary. Yesterday only the mysql server crashed but it also crashed the entire machine before. The memory usage in DA seems to be normal: directadmin directadmin (pid 3923 22158 22159 22160 22161 22162 )8.75 MB dovecot dovecot (pid 3851 ) 47.8 MB exim exim (pid 1350 ) 1.29 MB httpd (pid 21525 21528 21529 21530 21531 21532 21546 21571 21742 21743 21744 )490.4 MB mysqld mysqld (pid 1299 ) 287.8 MB named named (pid 3807 ) 16.3 MB proftpd proftpd (pid 1481 ) 1.91 MB sshd sshd (pid 1173 21494 ) 5.16 MB Restarting services immediately frees up memory, but slowly over time the memory usage increases(about 24 hours to crash). The commands: # sync # echo 3 > /proc/sys/vm/drop_caches Will free al memory correct. I could just create a cronjob but it seems the wrong way around to me. I can't seem to pinpoint the cause. Any advices, references or tips are highly appreciated! Greetings, Coen edit: free -m : after drop_caches: total used free shared buffers cached Mem: 3830 735 3095 0 0 21 -/+ buffers/cache: 712 3117 Swap: 991 0 991 I'll post another one this evening.

    Read the article

  • Google Chrome is running my system out of memory

    - by jasondavis
    I am running Windows 7 x64 with 12GB of RAM I often have multiple windows and a ton of tabs open. I use the extension Session Buddy to restore all my windows and tabs once the memory gets too high. So my 12gb of ram will get up to around 93% used because of Chrome, now I can close chrome down and restore the same amount of windows and tabs and it will only use about 25% of memory, it then over time increases back up to the 90% zone after several hours. It seems that when I close tabs, instead of freeing that memory up, it doesn't so that is why the huge increase of memory usage as new tabs are opened and closed it just adds up, this sounds like a huge bug in chrome. Just for an example I just re-booted my system, I only have 1 window with 4 tabs open and in the task manager, it shows 29 chrome.exe processes I then killed all chrome processes and opened a chrome window with just 1 tab, it made 27 chrome.exe processes. Is this an issue that others have? More importantly, is there a fix? UPDATE I just read that each plugin and extension creates a chrome.exe process, I then couunted 24 extensions so that helps explain a portion of the large processes. Still not sure about memory not being freed up though!

    Read the article

  • MySQL Memory Limit Windows Server 2003

    - by Matt
    I am running MySQL 5.0.51a on Windows Server 2003 Standard Edition on an HP DL580 G4 with 3GB installed. One of my database tables has grown to 5.3 GB with an index file of 2.5 GB, which I believe is causing MySQL to be slow due to having to constantly load and unload the index file when updates are made to the table. The server itself seems to be performing OK because MySQL is only using about 500MB of memory (there are other apps running on the system, but MySQL uses the most memory). The table is fairly active with new records getting adding all during day but no deletes, ever. The MySQL server has up to 600 connections allowed, but only small number (10 or 20) would actually be writing to this table. I increased the memory limits in MySQL but since the max connections is so high I don't think I can give each connection 1GB without risking a problem. Is there some tuning that would let just certain connections get a lot of memory? So I have started to look for alternatives to avert the crisis I know is coming soon. Some of the options I have: Upgrade to Server 2003 Enterprise to install 64GB of memory. Question: would 32 bit MySQL be able to access more than 2GB? Would that be 2GB per thread? That would still be smaller than the index table size so it might not solve the problem completely, but it would be better than now. Upgrade to Server 200x 64 bit and MySQL 64 bit. Switch to a *nix 64 bit server. If anybody has suggestions for things to do in the meantime, opinions on which way to go, or other things that I have overlooked I would appreciate the help. Thanks

    Read the article

  • Why is my browser using so much memory?

    - by Steve
    Hi. I've recently had problems with Firefox running very slowly when I have many tabs open; say 20 tabs. My whole system would slow down. I decided to give Google Chrome a try, and it started out fine. But lately I am finding that it too, slows down my whole system. Looking at Task Manager, chrome.exe is using about 250MB of memory in about 6 different entries in task manager. However, when I shut Chrome down, memory usage is reduced by about 600MB. How can this be? (shows drop in memory usage after ending Chrome.) When my system locks up with Chrome having many tabs open, it takes 10 seconds to load the Start Menu, 10 seconds to expand All Programs, and each folder and subfolder, and 30 seconds for the program to be highlighted under my mouse. It also takes 10 seconds to switch to Notepad. Why is Chrome appearing to use so much more memory than Task Manager indicates? Why is my pagefile being used when I have around 1.1GB of memory? Can I set Chrome to run in RAM and not in the pagefile? How can 20 tabs use 600MB? That's 30MB per tab. Thanks for your help.

    Read the article

  • How to change memory for DomU runtime

    - by saffron
    I have a xen server with xen-4.1.3, linux-image-3.2.0-3-amd64, debian squeeze and 16Gb of RAM. The domain-0 has 1Gb of ram, the rest of memory belongs to the hypervisor. I want to start a guest domain with a minimal amount of memory and increase it runtime later. When I start a guest domain with 256Mb of ram and run xm mem-set domu 4Gb, I get ~3Gb only in domu and a guest domain free says: root@test:~# free total used free shared buffers cached Mem: 2830620 72868 2757752 0 2432 43504 -/+ buffers/cache: 26932 2803688 Swap: 1048572 0 1048572 And a guest domain dmesg says: [ 0.000000] Memory: 175912k/2883584k available (3527k kernel code, 448k absent, 2707224k reserved, 3210k data, 612k init) When I start a guest domain with 2Gb of ram I can run xm mem-set domu 7Gb and get ~7Gb of ram in a guest domain: root@test:~# free total used free shared buffers cached Mem: 6828228 74944 6753284 0 1328 12568 -/+ buffers/cache: 61048 6767180 Swap: 1048572 0 1048572 And a guest domain dmesg: [ 0.000000] Memory: 1674960k/16651264k available (3527k kernel code, 448k absent, 14975856k reserved, 3210k data, 612k init) How can I start a guest domain with a minimal amount of ram (256Mb) and increase it under 15Gb?

    Read the article

  • Imagemagick/File upload abuse causing my memory errors

    - by kidcapital
    I had been running out of memory on my server lately and I noticed some individuals uploading the same "file" over and over in quick succession which locks up my instance of mini_magick. Eventually the morgify gets stuck in an infinite look. I've taken care of it by having a daemon watch the morgify process if it get's out of control, but was wondering if there was a better solution You can see the same *.gif being uploading in quick succession. I tried downloading this file too, and it isn't even a gif. I don't know what it is (I can't open it). Anyone experience this kind of exploit before?

    Read the article

  • Memory leak in xbap application

    - by Arvind
    Hi, We are using many custom controls by inheriting form the WPFcontrols as the base and customizing it for our need. However, the memory used by these controls are not released, even after pages using the controls are closed, until the whole application is closed. As these application has to work for a whole day performance decreases as more and more memory gets held up. When we profiled our page we found that the controls where not getting collected as there where some binding reference or some borders or brushes etc not getting cleared from that control. We tried to use the Unload event of the controls to remove the events and some references from the control. This reduced the leak to some extent but this was slowing down closing of the page also the unload event was getting triggered when the control was even collapsed. Is there any other ways to overcome the leak? Are there any best practices to prevent memory leaks? Thanks Arvind

    Read the article

  • AVAudioRecorder Memory Leak

    - by Eric Ranschau
    I'm hoping someone out there can back me up on this... I've been working on an application that allows the end user to record a small audio file for later playback and am in the process of testing for memory leaks. I continue to very consistently run into a memory leak when the AVAudioRecorder's "stop" method attempts to close the audio file to which it's been recording. This really seems to be a leak in the framework itself, but if I'm being a bonehead you can tell me. To illustrate, I've worked up a stripped down test app that does nothing but start/stop a recording w/ the press of a button. For the sake of simplicty, everything happens in app. delegate as follows: @synthesize audioRecorder, button; @synthesize window; - (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // create compplete path to database NSString *tempPath = NSTemporaryDirectory(); NSString *audioFilePath = [tempPath stringByAppendingString:@"/customStatement.caf"]; // define audio file url NSURL *audioFileURL = [[NSURL alloc] initFileURLWithPath:audioFilePath]; // define audio recorder settings NSDictionary *settings = [[NSDictionary alloc] initWithObjectsAndKeys: [NSNumber numberWithInt:kAudioFormatAppleIMA4], AVFormatIDKey, [NSNumber numberWithInt:1], AVNumberOfChannelsKey, [NSNumber numberWithInt:AVAudioQualityLow], AVSampleRateConverterAudioQualityKey, [NSNumber numberWithFloat:44100], AVSampleRateKey, [NSNumber numberWithInt:8], AVLinearPCMBitDepthKey, nil ]; // define audio recorder audioRecorder = [[AVAudioRecorder alloc] initWithURL:audioFileURL settings:settings error:nil]; [audioRecorder setDelegate:self]; [audioRecorder setMeteringEnabled:YES]; [audioRecorder prepareToRecord]; // define record button button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; [button addTarget:self action:@selector(handleTouch_recordButton) forControlEvents:UIControlEventTouchUpInside]; [button setFrame:CGRectMake(110.0, 217.5, 100.0, 45.0)]; [button setTitle:@"Record" forState:UIControlStateNormal]; [button setTitle:@"Stop" forState:UIControlStateSelected]; // configure the main view controller UIViewController *viewController = [[UIViewController alloc] init]; [viewController.view addSubview:button]; // add controllers to window [window addSubview:viewController.view]; [window makeKeyAndVisible]; // release [audioFileURL release]; [settings release]; [viewController release]; return YES; } - (void) handleTouch_recordButton { if ( ![button isSelected] ) { [button setSelected:YES]; [audioRecorder record]; } else { [button setSelected:NO]; [audioRecorder stop]; } } - (void) dealloc { [audioRecorder release]; [button release]; [window release]; [super dealloc]; } The stack trace from Instruments that shows pretty clearly that the "closeFile" method in the AVFoundation code is leaking...something. You can see a screen shot of the Instruments session here: Developer Forums: AVAudioRecorder Memory Leak Any thoughts would be greatly appreciated!

    Read the article

  • Flex 4 Spark VideoDisplay in Popup causes memory leak

    - by Ben
    Hi, I'm currently building an air app with FB 4. I have a custom control that contains a VideoDisplay control, and which loaded using the PopupManager. Using the profiler, i've noticed that every time the my popup is loaded the memory for it gets allocated, but when it's closed the memory is never recovered. There's nothing else holding a reference to the popup. And if I don't set the source of the VideoDisplay object, then there is no leak - but as soon as the source is set I get a leak. I can't see any method to force close the stream or anything on the spark VideoDisplay control. Any idea or suggestions? EDIT: I have tried setting the source to null before closing the popup but that doesn't change anything. Also, I'm not holding any event listener to the video

    Read the article

  • SQL 2008 SMO Database Status property memory leak.

    - by AKoran
    It appears there is a memory leak in the Status property of the SMO Database class. Using the code below with SQL 2005 SMO libraries works fine, but as soon as you use SQL 2008, the memory leak appears.... Any other good way of getting the database staus in SQL 2008? A quick example that magnifies the problem: private void button1_Click(object sender, RoutedEventArgs e) { for (int x = 0; x < 100; x++) { CheckStatus(); } } private void CheckStatus() { Server server = new Server("YourServer"); DatabaseCollection dbc = server.Databases; if (dbc.Contains("YourDatabase")) { DatabaseStatus dbStatus = dbc["YourDatabase"].Status; } }

    Read the article

  • Leak - GeneralBlock-3584

    - by lamicka
    When i try to check leaks of my iPhone App using Instruments, everything is just fine. Same App on actual real device shows this leak for a few times during the app launch. It is pretty non-deterministic and it happens in system libraries. I tried to google down the solution without a luck. Anyone experiencing the same problems? Anyone knows the solution? I find interesting, that every of my leak in code will crash the app sooner or later. These GeneralBlock-3584 leaks keeps app perfectly stable. Might this be reason for AppStore rejection? Thanx for any answer regarding this undocumented problem (Apple is silent unfortunately).

    Read the article

  • How to fix this window.open memory leak?

    - by DotnetShadow
    Hi there, I was recently looking at this memory leak tool sIEve: http://home.orange.nl/jsrosman/ So I decided to test out the tool by creating a main page that will open up a popup window. I started by creating 3 pages: index.html, page1.html and page2.html, the index.html page will open a child window (popup) linking to page1.html. Page1 will have a anchor tag that links to page2.html, while page2 will have a link back to page1.html PROBLEM So in the tool I entered the index.html page, popup window opened to page1.html, I then clicked the page2 link, no leaks detected yet. While I'm on page2 I click the link back to page1, and that's where the tool claims there is a link. The leak seems to be happening on the index.html page and I have no idea as to why it would be doing that. Even more concerning is that I can see elements that the tool detects that aren't even on my page. Does anyone have any experience with this tool or know if this really is a memory leak? Any samples of showing how to achieve what I'm doing without memory leaks? INDEX.HTML <script type="text/javascript"> MYLEAK = function() { var childWindow = null; function showWindow() { childWindow = window.open("page1.html", "myWindow"); return false; } return { init: function() { $("#window-link").bind("click", showWindow); } } }(); </script> </head> <body> <a id="window-link" href="#" on>Open Window</a> <script type="text/javascript"> $(document).ready(function() { MYLEAK.init(); }); </script> </body> </html> PAGE1.HTML <html> <body> <h1>Page 1</h1> <a href="page2.html">Page2</a> </body> </html> PAGE2.HTML <html> <body> <h1>Page 2</h1> <a href="page1.html">Page1</a> </body> </html> Appreciate your efforts.

    Read the article

  • Good memory profiling, leak and error detection for Windows

    - by Fernando
    I'm currently looking for a good memory / leak detection tool for Windows. A few years ago, I used Numega's Boundschecker, which was VERY good. Right now it seems to have been sold to Compuware, which apparently sold it again to some other company. Trying to evaluate a demo of the current version has been so far very frustrating, in the best "enterprisy" tradition: (a) no advertised prices on their website (Great Red Flashing Lights of Warning); (b) contact form asked for number of employeers and other private information; (c) no response to my emails asking for a evaluation and price. I had to conclude that BoundsChecker is now one of "those" products. Y'know, the type where you innocently call and tomorrow 3 men in black suits turn up at your building wanting to talk to you about "partnerships" and not-so-secretly gauge the size of your company and therefore how much they can get away with charging you. SO, rant aside, can anyone recommend an excellent memory checking/leak detection tool, how much it costs, and suggestions for where to buy?

    Read the article

  • Leak in NSScanner category method

    - by jluckyiv
    I created an NSScanner category method that shows a leak in instruments. - (BOOL)scanBetweenPrefix:(NSString *)prefix andSuffix:(NSString *)suffix intoString:(NSString **)value { NSCharacterSet *charactersToBeSkipped = [self charactersToBeSkipped]; [self setCharactersToBeSkipped:nil]; BOOL result = NO; // find the prefix; the scanString method below fails if you don't do this if (![self scanUpToString:prefix intoString:nil]) { MY_LOG(@"Prefix %@ is missing.", prefix); return result; } //scan the prefix and discard [self scanString:prefix intoString:nil]; // scan the important part and save it if ([self scanUpToString:suffix intoString:value]) // this line leaks { result = YES; } [self setCharactersToBeSkipped:charactersToBeSkipped]; return result; } I figure it's the way I'm passing the value to/from the method, but I'm not sure. It's a small leak (32 bytes), but I'd like to do this right if I can. Thanks in advance.

    Read the article

  • Retrieve Heap memory size and its usage statistics etc...?

    - by AKN
    Lets say I open some application or process. Did some work with that. Now I closed it. Need to know whether this application caused any memory leak. i.e used up some heap memory and not cleared it properly. Can I get this statistics some how? I'm using Visual Studio (for development) under Windows OS. Even I would be interested in knowing this information for any 3rd party application.

    Read the article

  • Where to check for heap memory size and its usage statistics etc... in windows?

    - by AKN
    Lets say I open some application or process. Did some work with that. Now I closed it. Need to know whether this application caused any memory leak. i.e used up some heap memory and not cleared it properly. Can I get this statistics some how? I'm using Visual Studio (for development) under Windows OS. Even I would be interested in knowing this information for any 3rd party application.

    Read the article

  • Adobe Reader 9.0 memory leak while loading-unloading PDF files every one second indefinitely

    - by Total Starnger
    I have c++ written MFC based application that has PDF object viewer as a part of the implementation. A whole thing works just fine with Adobe Reader 8.0. Once I switched to Adobe Reader 9.0 as a default PDF reader, I keep experiencing small memory leak that forces my application to crash within a half an hour of continuous loading-unloading different PDF files. Any ideas what might cause this memory leak and is there any cure besides replacing Adobe Reader 9.0 with anything else? (Works fine with Foxit PDF reader as well, by the way..)

    Read the article

  • Iphone memory leak with malloc

    - by Icky
    Hello. I have memory leak, found by instruments and it is supposed to be in this line of code: indices = malloc( sizeof(indices[0]) * totalQuads * 6); This is actually a code snippet from a tutorial, something which i think is leak-free so to say. Now I reckon, the error is somewhere else, but I do not know, where. These are the last trackbacks: 5 ColorRun -[EAGLView initWithCoder:] /Users/thomaskopinski/programming/colorrun_3.26/Classes/EAGLView.m:98 4 ColorRun -[EAGLView initGame] /Users/thomaskopinski/programming/colorrun_3.26/Classes/EAGLView.m:201 3 ColorRun -[SpriteSheet initWithImageNamed:spriteWidth:spriteHeight:spacing:imageScale:] /Users/thomaskopinski/programming/colorrun_3.26/SpriteSheet.m:68 2 ColorRun -[Image initWithImage:scale:] /Users/thomaskopinski/programming/colorrun_3.26/Image.m:122 1 ColorRun -[Image initImpl] /Users/thomaskopinski/programming/colorrun_3.26/Image.m:158 0 libSystem.B.dylib malloc Does anyone know how to approach this?

    Read the article

  • ANTS Memory Profiler 7.0

    - by James Michael Hare
    I had always been a fan of ANTS products (Reflector is absolutely invaluable, and their performance profiler is great as well – very easy to use!), so I was curious to see what the ANTS Memory Profiler could show me. Background While a performance profiler will track how much time is typically spent in each unit of code, a memory profiler gives you much more detail on how and where your memory is being consumed and released in a program. As an example, I’d been working on a data access layer at work to call a market data web service.  This web service would take a list of symbols to quote and would return back the quote data.  To help consolidate the thousands of web requests per second we get and reduce load on the web services, we implemented a 5-second cache of quote data.  Not quite long enough to where customers will typically notice a quote go “stale”, but just long enough to be able to collapse multiple quote requests for the same symbol in a short period of time. A 5-second cache may not sound like much, but it actually pays off by saving us roughly 42% of our web service calls, while still providing relatively up-to-date information.  The question is whether or not the extra memory involved in maintaining the cache was worth it, so I decided to fire up the ANTS Memory Profiler and take a look at memory usage. First Impressions The main thing I’ve always loved about the ANTS tools is their ease of use.  Pretty much everything is right there in front of you in a way that makes it easy for you to find what you need with little digging required.  I’ve worked with other, older profilers before (that shall remain nameless other than to hint it was created by a very large chip maker) where it was a mind boggling experience to figure out how to do simple tasks. Not so with AMP.  The opening dialog is very straightforward.  You can choose from here whether to debug an executable, a web application (either in IIS or from VS’s web development server), windows services, etc. So I chose a .NET Executable and navigated to the build location of my test harness.  Then began profiling. At this point while the application is running, you can see a chart of the memory as it ebbs and wanes with allocations and collections.  At any given point in time, you can take snapshots (to compare states) zoom in, or choose to stop at any time.  Snapshots Taking a snapshot also gives you a breakdown of the managed memory heaps for each generation so you get an idea how many objects are staying around for extended periods of time (as an object lives and survives collections, it gets promoted into higher generations where collection becomes less frequent). Generating a snapshot brings up an analysis view with very handy graphs that show your generation sizes.  Almost all my memory is in Generation 1 in the managed memory component of the first graph, which is good news to me, because Gen 2 collections are much rarer.  I once3 made the mistake once of caching data for 30 minutes and found it didn’t get collected very quick after I released my reference because it had been promoted to Gen 2 – doh! Analysis It looks like (from the second pie chart) that the majority of the allocations were in the string class.  This also is expected for me because the majority of the memory allocated is in the web service responses, so it doesn’t seem the entities I’m adapting to (to prevent being too tightly coupled to the web service proxy classes, which can change easily out from under me) aren’t taking a significant portion of memory. I also appreciate that they have clear summary text in key places such as “No issues with large object heap fragmentation were detected”.  For novice users, this type of summary information can be critical to getting them to use a tool and develop a good working knowledge of it. There is also a handy link at the bottom for “What to look for on the summary” which loads a web page of help on key points to look for. Clicking over to the session overview, it’s easy to compare the samples at each snapshot to see how your memory is growing, shrinking, or staying relatively the same.  Looking at my snapshots, I’m pretty happy with the fact that memory allocation and heap size seems to be fairly stable and in control: Once again, you can check on the large object heap, generation one heap, and generation two heap across each snapshot to spot trends. Back on the analysis tab, we can go to the [Class List] button to get an idea what classes are making up the majority of our memory usage.  As was little surprise to me, System.String was the clear majority of my allocations, though I found it surprising that the System.Reflection.RuntimeMehtodInfo came in second.  I was curious about this, so I selected it and went into the [Instance Categorizer].  This view let me see where these instances to RuntimeMehtodInfo were coming from. So I scrolled back through the graph, and discovered that these were being held by the System.ServiceModel.ChannelFactoryRefCache and I was satisfied this was just an artifact of my WCF proxy. I also like that down at the bottom of the Instance Categorizer it gives you a series of filters and offers to guide you on which filter to use based on the problem you are trying to find.  For example, if I suspected a memory leak, I might try to filter for survivors in growing classes.  This means that for instances of a class that are growing in memory (more are being created than cleaned up), which ones are survivors (not collected) from garbage collection.  This might allow me to drill down and find places where I’m holding onto references by mistake and not freeing them! Finally, if you want to really see all your instances and who is holding onto them (preventing collection), you can go to the “Instance Retention Graph” which creates a graph showing what references are being held in memory and who is holding onto them. Visual Studio Integration Of course, VS has its own profiler built in – and for a free bundled profiler it is quite capable – but AMP gives a much cleaner and easier-to-use experience, and when you install it you also get the option of letting it integrate directly into VS. So once you go back into VS after installation, you’ll notice an ANTS menu which lets you launch the ANTS profiler directly from Visual Studio.   Clicking on one of these options fires up the project in the profiler immediately, allowing you to get right in.  It doesn’t integrate with the Visual Studio windows themselves (like the VS profiler does), but still the plethora of information it provides and the clear and concise manner in which it presents it makes it well worth it. Summary If you like the ANTS series of tools, you shouldn’t be disappointed with the ANTS Memory Profiler.  It was so easy to use that I was able to jump in with very little product knowledge and get the information I was looking it for. I’ve used other profilers before that came with 3-inch thick tomes that you had to read in order to get anywhere with the tool, and this one is not like that at all.  It’s built for your everyday developer to get in and find their problems quickly, and I like that! Tweet Technorati Tags: Influencers,ANTS,Memory,Profiler

    Read the article

  • Crash on iOS when system purges memory and closes a UIViewController

    - by Amiramix
    My application is crashing when one of the views is purged from memory because of low-memory condition. At least this is what I understand from the crashlog. It happens on numerous screens but only when opening a Facebook dialog (using the Facebook SDK). Basically, looks like the system sometimes runs out of memory when we need to present a Facebook dialog (e.g. to let user post something on the Facebook timeline). Date/Time: 2012-03-14 19:47:33.819 +0000 OS Version: iPhone OS 5.1 (9B176) Report Version: 104 Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x30000008 Crashed Thread: 0 Thread 0 name: Dispatch queue: com.apple.main-thread Thread 0 Crashed: 0 libobjc.A.dylib 0x30f2bf78 objc_msgSend + 16 1 MyApp 0x00003c0e -LTBaseViewController viewDidUnload (LTBaseViewController.m:145) 2 MyApp 0x00004ea2 -LTBaseTableViewController viewDidUnload (LTBaseTableViewController.m:90) 3 UIKit 0x33766bd8 -[UIViewController unloadViewForced:] + 244 4 UIKit 0x338ae492 -[UIViewController purgeMemoryForReason:] + 58 5 Foundation 0x3071a4f8 __57-NSNotificationCenter addObserver:selector:name:object:_block_invoke_0 + 12 6 CoreFoundation 0x30e95540 ___CFXNotificationPost_block_invoke_0 + 64 7 CoreFoundation 0x30e21090 _CFXNotificationPost + 1400 8 Foundation 0x3068e3e4 -NSNotificationCenter postNotificationName:object:userInfo: + 60 9 Foundation 0x3068fc14 -NSNotificationCenter postNotificationName:object: + 24 10 UIKit 0x3387926a -UIApplication _performMemoryWarning + 74 11 UIKit 0x33879364 -UIApplication _receivedMemoryNotification + 168 12 libdispatch.dylib 0x36a12252 _dispatch_source_invoke + 510 13 libdispatch.dylib 0x36a0fb1e _dispatch_queue_invoke$VARIANT$up + 42 14 libdispatch.dylib 0x36a0fe64 _dispatch_main_queue_callback_4CF$VARIANT$up + 152 15 CoreFoundation 0x30e9c2a6 __CFRunLoopRun + 1262 16 CoreFoundation 0x30e1f49e CFRunLoopRunSpecific + 294 17 CoreFoundation 0x30e1f366 CFRunLoopRunInMode + 98 18 GraphicsServices 0x33fb6432 GSEventRunModal + 130 19 UIKit 0x336f5e76 UIApplicationMain + 1074 20 MyApp 0x00004818 main (main.m:16) 21 MyApp 0x000023b4 0x1000 + 5044 I checked and there are almost no memory leaks, e.g. when testing the app for an hour the total memory leaked was around 2-3Kb caused by some string-copying libraries. So I don't believe this is caused by the application. I guess that when the phone is not restarted for some time there are applications running in the background and when using Facebook SDK the memory becomes a problem and the system tries to recover the memory from random applications, including my application. My question is, how can I prevent this crash from happening? How should I handle unloadViewForced on a view controller to make the app more robust in low-memory conditions? And lastly, am I right that this crashlog suggests the crash occurred because the system tried to free memory and my application didn't handle it properly? Any help greatly appreciated.

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >