Search Results

Search found 30 results on 2 pages for 'memoryleak'.

Page 1/2 | 1 2  | Next Page >

  • Understanding addSubview: memoryLeak

    - by Leandros
    I don't really understand, why this code leaks. ParentViewController *parentController = [[ParentViewController alloc] init]; ChildViewController *childController = [[ChildViewController alloc] init]; [parentController containerAddChildViewController:childController]; [[self window] setRootViewController:parentController]; - (void)containerAddChildViewController:(UIViewController *)childViewController { [self addChildViewController:childViewController]; [self.view addSubview:childViewController.view]; // Instruments is telling me, the leak occurs here! [childViewController didMoveToParentViewController:self]; } According to Instruments, this line: [self.view addSubview:childViewController.view]; is leaking. The whole code is called once in application:didFinishLaunchingWithOptions:, but it is shown that this code is responsible for 30 leaks (approx. 1.12 kB).

    Read the article

  • UIAlertView -show causing a memory leak

    - by Erik
    I'm relatively new to iPhone Development, so this may be my fault, but it goes against what I've seen. :) I think that I'm creating a UIAlertView that lives just in this vaccuum of the 'if' statement. NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error]; if(!data) { // Add an alert UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Unable to contact server" delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil]; NSLog(@"retain count before show: %i", alert.retainCount); [alert show]; NSLog(@"retain count before release: %i", alert.retainCount); [alert release]; NSLog(@"retain count after release: %i", alert.retainCount); return nil; } However, the console logs baffle me. retain count before show: 1 retain count before release: 6 retain count after release: 5 I've tried also adding: alert = nil; after the release. That makes the retain count 0, but I still show a leak. And if it helps, the leak's Responsible Frame is UIKeyboardInputManagerClassForInputMode. I'm also using OS 4 Beta 3. So anyone have any ideas how a local UIAlertView's retain count would increment itself by 5 when calling -show? Thanks for your help!

    Read the article

  • My app crashes after multiple rotates

    - by Ian Rae
    My app is crashing when I try and rotate it more than a couple of times. I first thought it was just the iPhone Simulator, so I loaded the app onto an iPod touch, and it crashed after fewer rotates in a row. I suspect it's a memory leak in one of my rotate methods. The only place I can think that the crash is being caused is in willRotateToInterfaceOrientation:duration:. The only two methods related to rotate that I've added/extended are shouldAutorotateToInterfaceOrientation: and willRotateToInterfaceOrientation:duration and I don't think it's the first because it only contains the two words: return YES;. Here is my willRotateToInterfaceOrientation:duration: method so you can review it and see where the possible memory leak is. -(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)orientation duration:(NSTimeInterval)duration { UIFont *theFont; if ((orientation == UIInterfaceOrientationLandscapeLeft) || (orientation == UIInterfaceOrientationLandscapeRight)) { theFont = [yearByYear.font fontWithSize:16.0]; yearByYear.font = theFont; [theview setContentSize:CGSizeMake(460.0f, 635.0f)]; } else { theFont = [yearByYear.font fontWithSize:10.0]; yearByYear.font = theFont; [theview setContentSize:CGSizeMake(300.0f, 460.0f)]; } [theFont release]; } yearByYear is a UITextView theview is a UIScrollView if anyone has any idea of why my app is crashing, I would be greatly appreciative.

    Read the article

  • Application leaking Strings?

    - by Jörg B.
    My .net application does some heavy string loading/manipulation and unfortunately the memory consumption keeps rising and rising and when looking at it with a profiler I see alot of unreleased string instances. Now at one point of time or another I do need all objects t hat do have these string fields, but once done, I could get rid of e.g. the half of it and I Dispose() and set the instances to null, but the Garbage Collector does not to pick that up.. they remain in memory (even after half an hour after disposing etc). Now how do I get properly rid of unneeded strings/object instances in order to release them? They are nowhere referenced anymore (afaik) but e.g. aspose's memory profiler says their distance to the gc's root is '3'?

    Read the article

  • Identify memory leak in Java app

    - by Vincent Ma
    One important advantage of java is programer don't care memory management and GC handle it well. Maybe this is one reason why java is more popular. As Java programer you real dont care it? After you meet Out of memory you will realize it it’s not true. Java GC and memory is big topic you can get some information in here Today just let me show how to identify memory leak quickly. Let quickly review demo java code, it’s one kind of memory leak in our code, using static collection and always add some object. import java.util.ArrayList;import java.util.List; public class MemoryTest { public static void main(String[] args) { new Thread(new MemoryLeak(), "MemoryLeak").start(); }} class MemoryLeak implements Runnable { public static List<Integer> leakList = new ArrayList<Integer>(); public void run() { int num =0; while(true) { try { Thread.sleep(1); } catch (InterruptedException e) { } num++; Integer i = new Integer(num); leakList.add(i); } }} run it with java -verbose:gc -XX:+PrintGCDetails -Xmx60m -XX:MaxPermSize=160m MemoryTest after about some minuts you will get Exception in thread "MemoryLeak" java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Arrays.java:2760) at java.util.Arrays.copyOf(Arrays.java:2734) at java.util.ArrayList.ensureCapacity(ArrayList.java:167) at java.util.ArrayList.add(ArrayList.java:351) at MemoryLeak.run(MemoryTest.java:25) at java.lang.Thread.run(Thread.java:619)Heap def new generation total 18432K, used 3703K [0x045e0000, 0x059e0000, 0x059e0000) eden space 16384K, 22% used [0x045e0000, 0x0497dde0, 0x055e0000) from space 2048K, 0% used [0x055e0000, 0x055e0000, 0x057e0000) to space 2048K, 0% used [0x057e0000, 0x057e0000, 0x059e0000) tenured generation total 40960K, used 40959K [0x059e0000, 0x081e0000, 0x081e0000) the space 40960K, 99% used [0x059e0000, 0x081dfff8, 0x081e0000, 0x081e0000) compacting perm gen total 12288K, used 2083K [0x081e0000, 0x08de0000, 0x10de0000) the space 12288K, 16% used [0x081e0000, 0x083e8c50, 0x083e8e00, 0x08de0000)No shared spaces configured. OK let us quickly identify it using JProfile Download JProfile in here  Run JProfile and attach MemoryTest get largest size of  Objects in Memory View in here is Integer then select Integer and go to Heap Walker. get GC Graph for this object  Then you get detail code raise this issue quickly now.  That is enjoy it.

    Read the article

  • How to read the 3D chart data with directX?

    - by MemoryLeak
    I am reading a open source project, and I found there is a function which read 3D data(let's say a character) from obj file, and draw it . the source code: List<Vertex3f> verts=new List<Vertex3f>(); List<Vertex3f> norms=new List<Vertex3f>(); Groups=new List<ToothGroup>(); //ArrayList ALf=new ArrayList();//faces always part of a group List<Face> faces=new List<Face>(); MemoryStream stream=new MemoryStream(buffer); using(StreamReader sr = new StreamReader(stream)){ String line; Vertex3f vertex; string[] items; string[] subitems; Face face; ToothGroup group=null; while((line = sr.ReadLine()) != null) { if(line.StartsWith("#")//comment || line.StartsWith("mtllib")//material library. We build our own. || line.StartsWith("usemtl")//use material || line.StartsWith("o")) {//object. There's only one object continue; } if(line.StartsWith("v ")) {//vertex items=line.Split(new char[] { ' ' }); vertex=new Vertex3f();//float[3]; if(flipHorizontally) { vertex.X=-Convert.ToSingle(items[1],CultureInfo.InvariantCulture); } else { vertex.X=Convert.ToSingle(items[1],CultureInfo.InvariantCulture); } vertex.Y=Convert.ToSingle(items[2],CultureInfo.InvariantCulture); vertex.Z=Convert.ToSingle(items[3],CultureInfo.InvariantCulture); verts.Add(vertex); continue; } And why it need to read the data manually in directX? As far as I know, in XDA programming, we just need to call a function a load the resource. Is this because it is in DirectX, there is no function to read resource? If yes, then how to prepare the 3D resource ? in XDA we just need to use other software draw the 3D picture and then export. but what should I do in DirectX?

    Read the article

  • how to bind a winforms to a field ?

    - by MemoryLeak
    I use winforms to develop application, I want to know how can I use data binding to bind two radio button to a database field ? And if bind to a database field is too complicated, then can I save the value manually while leave other field bind to textbox and automatically update the value?

    Read the article

  • How can I make datagridview can only select the cells in the same column at a time?

    - by MemoryLeak
    I am using winforms to develop my application. And I set my datagridview control's selectionmode to "CellSelect", and this allow the user to select as many cells as he want which spread over several columns; but I want to constraint my user can only select cells in single column at a time, and there isn't any such kind of selectionmode for me. So If I want to implement this, how can I extend the datagridview class ? I also think that I can check in eventhandler whenever the selection cells are changed, through which I might make the user can not select cells spread over multiple columns, but this is not that good, I think. Can any other people help me to find out a better solution ?

    Read the article

  • How to programmly download image from website ?

    - by MemoryLeak
    I need to download images from a website, and I have the login name and password, but if i just use URL to download the image, it will throw a exception: there is no value in session. I think I need to login the website before I can programmingly download the image. Do you have any solutions ? Thanks in advance !

    Read the article

  • What design pattern will you choose ?

    - by MemoryLeak
    I want to design a class, which contains a procedure to achieve a goal. And it must follow some order to make sure the last method, let's say "ExecuteIt", to behave correctly. in such a case, what design patter will you use ? which can make sure that the user must call the public method according some ordering. If you really don't know what I am saying, then can you share me some concept of choosing a design patter, or what will you consider while design a class?

    Read the article

  • anyone research DevExpress' source code ?

    - by MemoryLeak
    I want to study the source code of DevExpress, does anyone have any information about that ? Since I really don't know how to start to read it. if you are also researching the source code of devexpress and you would share it on your blog, then could you please give me your blog link ? EDIT: once you purchase the universal version it will offer you the source for debugging, please refer to https://www.devexpress.com/ClientCenter/Order/default.aspx?group=.NET

    Read the article

  • what database should i choose ?

    - by MemoryLeak
    I use winforms to develop a desktop application, and right now I plan to use SQL server express, but the problem is, if i use sql server express, then the installation is much trouble, i need to install sql server first, and install my own applicaiton. Then I tried to use access 2003 as my database, then I only need to copy the mdb file with my application. But the access 's function is not that strong, the text length is limited to 255 byte. Is there any other database solution, which is easy to integrate to my application, and easy to install after i develop my application ? Many many desktop application have their own database, and easy to install and easy to use, what database do they use ?

    Read the article

  • why javascript can not read the cookie in asp.net ?

    - by MemoryLeak
    I want to read the sessionid in cookie which is automatically generated by asp.net. such as ASP.NET_SessionId. but when i use javascript: document.cookie = "ASP.NET_SessionId=;" since i want to set the ASP.NET_SessionId to be empty. but after the javascript executed, i found instead of change the ASP.NET_SessionId to empty, system generate a new cookie with ASP.NET_SessionId equal to empty. why system not modify the cookie but generate a new one ? Thanks!

    Read the article

  • How do you use data binding in C# development ?

    - by MemoryLeak
    Recently I use data binding to speed up my development of C# winforms application. But I found that data binding is just useful when the control is Textbox or textare and text kind of controls. If things come to be radio button, image control or datagridview, it's hard for me to use data binding. For example, it's hard for me to bind a group of radio button to a database field. It's hard for me to pre-process the data in database and then bind to datagridview control(I know I can use view to do this, but it is not that convenient) So I really want to know, most of you guys when will use data binding? And how will you use it ?

    Read the article

  • why jsf is better than struts ?

    - by MemoryLeak
    someone said to me that jsf is better to share information within context, but struts 1.1 can't. In JSR168, if we need to develop a portlet, share information in context is critical. so jsf is better option. so what is share information within context ? Does that mean that different application deployed in the same container can share date ? Or what other means ?

    Read the article

  • why datetime.now not work when I didn't use tolist?

    - by MemoryLeak
    When I use datacontext.News .Where(p => p.status == true) .Where(p => p.date <= DateTime.Now) .ToList(); the system will return no results; When I use datacontext.News .Where(p => p.status == true) .ToList() .Where(p => p.date <= DateTime.Now) .ToList(); system will return expected results. Can anyone tell me what's up? Thanks in advance !

    Read the article

  • How many objects can LINQ used to create per second ?

    - by MemoryLeak
    I used Linq to insert objects into database.But if i used threads to simultanously create 20 object within 1 second, then system will fail to add 20 objects into database. And I found it is not because of the sql server 's limit. so the only possible is Linq, any one have idea ? How can I create 20 records or more in 1 second within 1 second ?

    Read the article

1 2  | Next Page >