memory-management

iPhone app is crashing — error-message sent to deallocated instance 0xa58a950

吃可爱长大的小学妹 提交于 2020-01-14 06:01:27
问题 I n my iPhone app, I have implemented sidebar i.e. JTRevealSideBar to show the side bar on left side like facebook app But, the problem is it was crashing after clicking on the sidebar tableview for 1st index but for other index it is perfectly working Crash Log [sidebarViewController:didSelectObject:atIndexPath:]: message sent to deallocated instance 0xa58a950 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { if (self.sidebarDelegate) {

Are there tutorials or videos about how to use Instruments to find memory leaks?

风格不统一 提交于 2020-01-14 05:16:11
问题 I have found some big memory leaks with instruments but have no idea how to figure out where in my code they are. Need some tuts on how to go about that.... 回答1: Sounds like you need to do this: IPHONE: Analyzing leaks with instruments. It's not obvious from the Instruments' documentation. 回答2: Duplicate question, but here is a good tutorial. http://www.mobileorchard.com/find-iphone-memory-leaks-a-leaks-tool-tutorial/ Also, here's a link to the original question: How do you detect memory

Access violation and strange behavior of Visual Studio

若如初见. 提交于 2020-01-14 03:41:12
问题 I'm writing a test application on DirectX11, and I have 2 classes "Box" and "camera" . "Box" is a cube which is to be drawn on the screen, and this is "camera": class camera { public : const camera operator=(const camera& fv) const { return fv; } XMVECTOR eye; XMVECTOR at; XMVECTOR up; XMVECTOR right; XMVECTOR left; XMVECTOR down; float pitch; //x float roll; //z float yaw; //y XMMATRIX View; XMMATRIX Projection; camera(); camera(XMVECTOR eye, XMVECTOR at, XMVECTOR up, float movingOffset,

Memory leak with a lot of big images in iPad

时间秒杀一切 提交于 2020-01-14 03:26:09
问题 I'm trying to store UIImage datas in NSArray , actually 60 images, each with size of 300kb. Then, I'm trying to animate that images in UIImageView . My code: NSMutableArray *arr = [[NSMutableArray alloc] init]; for (int i=0; i<61; ++i) { [arr addObject:[UIImage imageNamed:[NSString stringWithFormat:@"%i.png", i]]]; } img.animationImages = arr; img.animationDuration = 1.5; img.contentMode = UIViewContentModeBottomLeft; [img startAnimating]; When I test it in iPad Simulator 4.3, it works fine.

Memory usage of MKMapView is very high

依然范特西╮ 提交于 2020-01-13 19:43:51
问题 So i have a UIScrollView with UIPageControl which has a bunch of MKMapViews (mostly 15 different maps). The app is really sluggish once this view loads and after a few minutes of usage i get a memory warning. I looked at it in Instruments and the maps take an insanely high chunk of memory. Even upto ~200mb sometimes. One thing i can think of is to reuse the mapViews. But because of how the views are structured the coding complexity increases. Any suggestions how i can improve performance?

High memory usage for small application

青春壹個敷衍的年華 提交于 2020-01-13 18:08:46
问题 im just building a very simple event based proxy monitor top disable the proxy settings depending on if a network location is available. the issue is that the application is a tiny 10KB and has minimal interface, but yet it uses 10MB of ram. The code is pretty simple: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Forms; using System.Net; using System.Net.NetworkInformation; using Microsoft.Win32; namespace WCSProxyMonitor { class

What is the difference between these two ways of creating NSStrings?

风流意气都作罢 提交于 2020-01-13 17:12:12
问题 NSString *myString = @"Hello"; NSString *myString = [NSString stringWithString:@"Hello"]; I understand that using method (1) creates a pointer to a string literal that is defined as static memory (and cannot be deallocated) and that using (2) creates an NSString object that will be autoreleased. Is using method (1) bad? What are the major differences? Is there any instances where you would want to use (1)? Is there a performance difference? P.S. I have searched extensively on Stack Overflow

What is the difference between these two ways of creating NSStrings?

独自空忆成欢 提交于 2020-01-13 17:11:25
问题 NSString *myString = @"Hello"; NSString *myString = [NSString stringWithString:@"Hello"]; I understand that using method (1) creates a pointer to a string literal that is defined as static memory (and cannot be deallocated) and that using (2) creates an NSString object that will be autoreleased. Is using method (1) bad? What are the major differences? Is there any instances where you would want to use (1)? Is there a performance difference? P.S. I have searched extensively on Stack Overflow

Android Static Variable Scope and Lifetime

让人想犯罪 __ 提交于 2020-01-13 12:07:32
问题 I have an application that has a Service that uses an ArrayList<Double> to store numbers in the background for a very long time; the variable is initialized when the service started. The service is in the background, and there will be frequent access to the variable (that's why I don't want to use file management or settings -- it will be very expensive for a file I/O for the sake of battery life). The variable will likely be ~1MB->2MB over its lifetime. Is it safe to say that the variable

declare fixed size character array on stack c++

风流意气都作罢 提交于 2020-01-13 11:43:33
问题 I am attempting to create a character array of a fixed size on the stack (it does need to be stack allocated). the problem I am having is I cannot get the stack to allocate more than 8 bytes to the array: #include <iostream> using namespace std; int main(){ char* str = new char[50]; cout << sizeof(str) << endl; return 0; } prints 8 How do I allocate a fixed size array (in this case 50 bytes. but it may be any number) on the stack? 回答1: char* str = new char[50]; cout << sizeof(str) << endl; It