[iPhone] Memory leak when UIWebview is loaded with URL
I have created a custom browser in my app using UIWebview . A memory leak is seen on everytime webview is loaded with provided url. A snapshot of the leak is shown below.You may note that no back trace is shown and hence cause of leak is unknown.
Snapshot of leak
Please help me with this issue as early as possible.
You might want to take this discussion to the developers forums. This is a general user to user forum for using the iPhone. This is way outside the scope of general use.
Similar Messages
-
Memory Leak in UIWebview on loading NSURLRequest
I have created a custom browser for my app. Whenever i load a url request into web view a memory leak is seen. A snapshot of the same is shown below
Please note that no backtrace has been shown which makes life more painful. In my application a simple webview is shown and a refresh button is given below webview. A snapshot of same is shown below
The code on refresh button is as follows
- (IBAction)refresh:(id)sender
// Some suggested solution on internet to fix leak but in vain
[wvWebView loadHTMLString:@"" baseURL:nil];
[wvWebView stopLoading];
wvWebView.delegate = nil;
// Clearing cache Memory
[[NSUserDefaults standardUserDefaults] setInteger:0 forKey:@"WebKitCacheModelPreferenceKey"];
[[NSURLCache sharedURLCache] removeAllCachedResponses];
[[NSURLCache sharedURLCache] setDiskCapacity:0];
[[NSURLCache sharedURLCache] setMemoryCapacity:0];
// Deleting all the cookies
for(NSHTTPCookie *cookie in [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies])
[[NSHTTPCookieStorage sharedHTTPCookieStorage] deleteCookie:cookie];
// Loading webview with desired url
[wvWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.google.com"]]];
Please help me to solve this issue as early as possibleI have seen other apps sucessfully running in AppStore. Is there something which I am missing ??????. Help me with the issue Guys.......... it's putting me out of businness.
-
Memory leak when I use function with bstr_t type
Hello,
I use Visual C++ 6 and TestStand 3.1.
I use the tool: Purify from Rational Instruments to detect memory leak in my code.
When I use in my code, functions from the TestStand API using bstr_t types: GetValString, GetType... memory leaks appear.
Do you have an idea to solve this problem?
ThanksBreizh,
Etes vous sur que le problèmes soit lié au type bstr_r ?
Pouvez vous me faire parvenir un exemple de code mettant en oeuvre la fuite mémoire?
Raphaël T.
NI FRANCE
Cordialement,
Raphael T -
App Memory Leak When Open iPhoto
Hi everyone,
Does anyone have experienced app memory leak when open iPhoto? My free memory immediate dropped from 5000 mb to 15mb when I open iPhoto and the app never open. If I force to quit iPhoto, all return to normal and everything work fine. I only have iPhoto app running, not sure what caused the memory leak???
Looking for help.
Thanks
JHMLActually the new library was a test to see if the problem occurred only with your current library or with all libraries. The fact that switching libraries cleared up the problem is just serendipitous.
-
Memory Leak when TOMCAT connects to Oracle 10g RAC using JDBC Thin driver.
We had experienced Memory leak when a Oracle 10g (10.2.0.3) RAC node was evicted. TOMCAT app server is connecting to the Oracle 10g RAC database instances using JDBC 10.2.0.3 thin driver.
Anyone had similar experience?
Any ideas? Any bugs reported/fixed?
Thanks,
RajIf you're doing XA, we absolutely do not support
driver-level load-balancing OR failover. Use neither.
For non-XA, you can use driver-level failover. For
non-XA, you could set load-balancing, but it won't
help because we get connections from the driver,
and keep them indefinitely, so the driver never gets
the chance to affect which connections the pool
uses after that. -
My Iphone Is Locked, When I Try Sync With Itunes ,The App Ask Me For The Owner Account which Is Erased Somebody Can Help Me?
I Want To Sync My Music But I Cant, Can Somebody Help Me ? ThanksLook, Idk If Is Blocked Or Something But When I Restored The Phone I Mean Factory, First Says That The phone Need A Sim Card,then An Icloud Account And Then This " This Phone Was Registered With An Apple Account,So I Know The Email and The Password, when i Try To Log In Its Says Password or EMail Incorrect so I Asked My Friend,Because I Didn't Buy it From An Apple Store Or Somethin Like That, So MY Friend Told Me That He Erased The Account or He desactivated I Need Help Seriously :s
-
Memory Leak when running Contacts
I am having a big memory leak when running the app Contacts on a MB Air. It gobbles up 2 GB of ram in just a few minutes forcing a reboot. I have re-installed Mountain Lion 10.8.2 and it still leaks memory. Watching Activity Monitor shows the rapid increase in Ram being gobbled up by Contacts. Used Mackeeper to clear cache as well as ran Cocktail, all to no avail. Any tips would be greatly appreciated.
The size of oracle.exe is not an indication of how the Java VM GC works; so you are not comparing apples to apples. It'll be too long to explain here but in my upcoming book (see hereafter), I gave a detailled explanation of the various memory areas the Java VM uses and how these are GCed and also how you can meausre their size (not all, though).
In short you want to use OracleRuntime methods such as
OracleRuntime.getSessionSize(); --> get he current size of Sessionspace
OracleRuntime.getNewspaceSize(); --> get he current size of Newspace
there are other memory areas described in the book
http://www.oracle.com/technology/pub/articles/mensah_dws.html
http://www.elsevier.com/wps/find/bookdescription.cws_home/706089/description#description
Sample chapter: http://www.oracle.com/technology/books/pdfs/mensah_ch1.pdf
Kuassi -
Memory leak when using Threads?
I did an experiment and noticed a memory leak when I was using threads.. Here's what I did.
======================================
while( true )
Scanner sc = new Scanner(System.in);
String answer;
System.out.print("Press Enter to continue...");
answer = sc.next();
new TestThread();
========================================
And TestThead is the following
========================================
import java.io.*;
import java.net.*;
public class TestThread extends Thread
public TestThread() { start(); }
public void run() { }
=====================================
When I open windows Task Manager, every time a new thread starts and stops, the java.exe increases the Mem Usage.. Its a memory leak!? What is going on in this situation.. If I start a thread and the it stops, and then I start a new thread, why does it use more memory?
-BrianMoveScanner sc = new
Scanner(System.in);out of the
loop.Scanner sc = new Scanner(System.in);
while (true) {
That won't matter in any meaningful way.
Every loop iteration creates a new Scanner, but it also makes a Scanner eligible for GC, so the net memory requirement of the program is constant.
Now, of course, it's possible that the VM won't bother GCing until 64 MB worth of Scanners have been created, but we don't care about that. If we're allowing the GC 64 MB, then we don't care how it uses it or when it cleans it up. -
i wana restore my iphone 3g but when i restore it with itunes after some time is say '' iphone could not restored unknow error 1015 '' help me please
99% because your iPhone was hacked/jailbroken. We cannot help you, see terms of use.
Error 1015: This error is typically caused by attempts to downgrade the software for an iPhone, iPad, or iPod touch. This can occur when you attempt to restore using an older .ipsw file. Downgrading to a previous version isn't supported. To resolve this issue, attempt to restore with the latest iPhone, iPad, or iPod touch software available from Apple. This error can also occur when an unauthorized modification of the iOS has occurred and you're now trying to restore to an authorized, default state. -
Memory leak when refreshing table models
Hi,
I have a memory leak in a GUI app, and i have traced the problem down to some JTables I have which display data from a database (I used Netbeans profiler to look at the number of objects created for different classes, and there are a large number of classes like com.mysql.jdbc.ResultSet, com.mysql.jdbc.Statement, com.mysql.jdbc.Field[] accumulating, aswell as lots of byte[] and char[] arrays). The allocation stack traces for these objects seem to point to my table models where I do a lot of database lookups to create the model.
Every time I am refreshing the tables, the Heap Space increases by a few MegaBytes, and a load of objects get created and retained. After refreshing the tables a number of times, the heap eventually gets filled and I get OutOfMemory error.
The problem is I don't understand how this is happening - when the tables are refreshed, the code I use is something like this:
setModel(new MyTableModel());
So theoretically each time I refresh, the old model should be garbage collected (because setting the new model means there are no references to the old model), but I get the feeling that all the models are accumulating in the heap and not being collected. I dont understand why this could be - I was wondering if anyone had any ideas? (PS My table models dont use any static fields)
Cheers,
jamesHi JacobsB,
The reason I'm setting new models (which I dont normally do) is that each time the table is refreshed, the number and type of columns may change. Since altering the column model is quite complicated (there is no convenient removeColumn() method of any of the standard model classes) and involves messing around with the column model, which ends up screwing up the whole model (e.g. column renderers, column count, column class etc.) I decided it was actually easier to just create a new model instead! Is there a way to alter the column structure another way?
later,
James -
Memory leak when we include child vo attributes in search reqion
Hi,
We have an ADF application (11.1.1.4) running in production. This application has around 100 pages and it takes load around 150-200 requests per second during peak time.
We have many search pages in this application which uses the feature of including child attributes in search region.
For Example - Let say we have MasterVO1 , ChildVO1, ChildVO2 , ChildVO3 ... , Now we have ViewCriteria (vc1)defined in MasterVO1 which includes attributes from ChildVO1, ChildVO2.. etc. We have query region in page basing on ViewCriteria(vc1) and MasterVO1, ChildVO1 , ChildVO2... are used as tables in page.
Now when we have page as mentioned above and with proper pooling parameters for AM (idle instance timeout - 5 minutes, minimum available pool size set to zero , pool polling interval - 7 min ) , we do a force GC for 3 - 4 times after every 10 min (we make sure we have no active users or sessions by this time). Now when we analyse the live heap dump we see AM , MasterVO1 , ChildVO1 and ChildVO2 remaining in heap.
We have repeated the same testcase by removing child attributes in viewcriteria and with same AM pooling parameters - now when we analyse the heap dump , we dont see AM or any of the VO's residing in live heap.
We are using the child attribute search feature heavily in our application - which is causing server to go out of memory for every 2-3 weeks.
Please suggest on this - Can this be bug with ADF?.
Thanks,
Naresh
Edited by: Naresh on Mar 20, 2013 9:37 AMHi Ramdeep,
Thanks for the reply - we dont have any custom code written on vo's or using vo's.
It's simple case - just drag and drop vc as query region and vo's as tables , then we see this leak. Most Importantly we dont see this leak when we dont have childvo attribute in viewcriteria/query region.
Any other clues ....
Thanks,
Naresh -
Memory leak when transferring files Lion
hi all, help I'm experiencing a memory leak since upgrading to Lion when transferring shared files between my macbook pro and imac. This occures through ethernet (wireless/wired) and firewire 800. No other apps are open except activity montior and finder. I am trying to transfer about 100g of itunes music / video files and pictures. Time machine backups to my TC do not have this affect.
When transfer starts the free memory slowly decreases whilst the inactive memory increases. Eventually the free memory drops below 10mg, active memory is approx 5-6gb and wired/active is about 2gb. Bascially as the free memory decreases the inactive memory increases however does not get realocated so the mac grinds to a halt and dies with lots of page outs etc.
this only happens when trying to transfer files. I have tried whole folders and just small individual ones and noticed the same event. I am struggling to find the cuase of the problem - any ideas?
mac os x 10.7.1
processor 2.53 GHz Intel Core i5
Memory 8 GB 1067 MHz DDR3
cheers, KevinI dont think you have a memory leak. I think the problem is the xml file is 1000000 records long and takes up too much memory. Even if you find a way to increase memory size, you are loading down the server too much for other people's applications to run. I suggest instead reading up on xml and learning how to read in only a few records at a time, processing it, and getting the next set of records to process. There are two methods to parse an xml file using an xml parser, one is to parse it all and put it in memory, the other is to process one record at a time (an xml book explains it better).
However, I question why you have reports that are 1000000 records long. end-users cannot effectively use such records (you cant scroll through 1000000 records). I suggest finding a way to greatly decrease the number of records in each file such as by providing just the records a particular user needs to do his job and not all records. For instance, put a textfield on his screen to let him only fetch records within a certain date range.
Lastly, I suggest putting your code in a try/catch/finally block where the finally block actually closes the objects. Example:
finally{
if(conn!=null)
conn.close();
} -
Memory leak when transferring pdf...help needed
Dear All,
I'm a newbie in developing java app. I'm making a web based application in reporting using JSP. java 1.6.02, jasper report 204, i-report 2.0.0
Client : OS : Win xp, memory 512MB
Server : Tomcat 6.0
DB Server : SQL Server 2005
OS Server : Windows Server 2003, memory 1GB
Report spec : .pdf based, with up to 1million record
Here's the code :
String query;
try {
String filereport = request.getRealPath("division/accounting/template/POReport.jrxml");
InputStream input = new FileInputStream(filereport);
Class.forName(odbcDriver);
Connection conn = DriverManager.getConnection(odbcURL,username,passwd);
ResultSet rset = null;
CallableStatement cs = null;
query = "{ call sp_tpo_list }";
cs = conn.prepareCall(query);
rset = cs.executeQuery();
JRDataSource dataSource = new JRResultSetDataSource(rset);
JasperDesign design = JRXmlLoader.load(input);
JasperReport report = JasperCompileManager.compileReport(design);
JasperPrint print = JasperFillManager.fillReport(report, null, dataSource);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
JasperExportManager.exportReportToPdfStream(print, baos);
response.setContentType("application/pdf");
response.setContentLength(baos.size());
ServletOutputStream sos;
sos = response.getOutputStream();
baos.writeTo(sos);
sos.flush();
rset.close();
cs.close();
conn.close();
sos.close();
baos.close();
input.close();
catch (FileNotFoundException fe) {}
catch (JRException jre) {}
catch (ClassNotFoundException cnfe) {}
catch (SQLException sqle) {}
catch (IOException ioe) {}I've already increase heap memory in Tomcat Manager -Xms 64Mb -Xmx 512Mb.
But when i test with 1million record, out of heap memory error is coming out.
When i test with 500.000 record, it work out, but only when 1 client access. More than 1 client, out of heap memory error generated by the system.
How can this happen? How can i detect memory leaks occured in the program?
And pls let me know if you see something is missing in the code above.
Thank youI dont think you have a memory leak. I think the problem is the xml file is 1000000 records long and takes up too much memory. Even if you find a way to increase memory size, you are loading down the server too much for other people's applications to run. I suggest instead reading up on xml and learning how to read in only a few records at a time, processing it, and getting the next set of records to process. There are two methods to parse an xml file using an xml parser, one is to parse it all and put it in memory, the other is to process one record at a time (an xml book explains it better).
However, I question why you have reports that are 1000000 records long. end-users cannot effectively use such records (you cant scroll through 1000000 records). I suggest finding a way to greatly decrease the number of records in each file such as by providing just the records a particular user needs to do his job and not all records. For instance, put a textfield on his screen to let him only fetch records within a certain date range.
Lastly, I suggest putting your code in a try/catch/finally block where the finally block actually closes the objects. Example:
finally{
if(conn!=null)
conn.close();
} -
Memory leak when pushView an popView
Hello to community!
I am having problems of memory leaks with an app I had build. After using it for 30-40 min it begin to go slow and slow.
The app show images as a catalog, but when I push and pop the views my memory rise a lot.
I think I am deleting all my oibjects setting them to to null and disposing all de bitmapdata that I use so I think that the problem should not be there.
I have 3 views in my app menuView.mxml,categoriesView.mxml and productsView.mxml.
My App begin in my pc (not in tablet) with TotalMemory: 47Mb and Private Memory : 88 MB
After pushing and poping the views for 5 times I get TotalMemory: 61Mb and Private Memory : 101 MB
Imagine if I do this for 20 times, all the app begin to go very slow in my Ipad or my Samsung Galaxy Tab.
Why is this happening? I have no idea how to solve this.
Thanks a lot!!
I put some code below.
Whe I am in menuView i use the following code to push the view from menuView to categoriesView
protected function button3_clickHandler(event:MouseEvent):void
if((FlexGlobals.topLevelApplication.getIdClienteServidorCompraActual()!=null)&&(FlexGloba ls.topLevelApplication.getIdClienteServidorCompraActual()>0))
navigator.pushView(categoriesView);
Whe I am in categoriesView i use the following code to push the view from categoriesView to productsView. In this view i have 3 button for each category.
protected function buttonC1_clickHandler(event:MouseEvent):void
//Categoria general con todos
var ab:ArrayCollection = getIdAmbienteServidor();
cleanMemory();
navigator.pushView(productsView, null);
private function cleanMemory():void
result.splice(0);
result = null;
System.gc();
Whe I am in productsView I use the following code to pop(I USE PUSH INSTEAD OF POP DUE TO DIFFERENT OPTIONS I HAVE) the view from productsView to categoriesView .
protected function button1_clickHandler(event:MouseEvent):void
cleanMemory();
navigator.pushView(menuView);
private function cleanMemory():void
if(image1 != null)
image1.source = "";
if(image1.bitmapData != null)
image1.bitmapData.dispose();
if(image2 != null)
image2.source = "";
if(image2.bitmapData != null)
image2.bitmapData.dispose();
if(result != null)
result.splice(0);
result = null;
if(result1 != null)
result1.splice(0);
result1 = null;
if(result2 != null)
result2.splice(0);
result2 = null;
dbConnection = null;
object1 = null;
object2 = null;
dataToSave = null;
cGreyImageSmallAsset = null;
cRedImageSmallAsset.bitmapData.dispose();
cRedImageSmallAsset = null;
cOrangeImageAsset.bitmapData.dispose();
cOrangeImageAsset = null;
cGreenImageAsset.bitmapData.dispose();
cGreenImageAsset = null;
cPinkImageAsset.bitmapData.dispose();
cPinkImageAsset = null;
cBlueImageAsset.bitmapData.dispose();
cBlueImageAsset = null;
cGreyImageAsset.bitmapData.dispose();
cGreyImageAsset = null;
cRedImageAsset.bitmapData.dispose();
cRedImageAsset = null;
cGreenImageSmall = null;
cOrangeImageSmall = null;
cPinkImageSmall = null;
cBlueImageSmall = null;
cGreyImageSmall = null;
cRedImageSmall= null;
cGreenImage = null;
cPinkImage = null;
cBlueImage= null;
cGreyImage = null;
cRedImage= null;
cOrangeImage= null;
System.gc();
I load the images with.
private function setImages():void
//var width:Number = FlexGlobals.topLevelApplication.width;
if(object1!=null)
//var widthImage1:Number = (width/2)-80;
//image1.width = widthImage1;
panelLeft.visible = true;
buttonLeftMore.visible = true;
image1.source = "file://" + File.applicationStorageDirectory.nativePath + "/b"+object1.idArchivo+"_500.jpg";
setObject1MainTexts();
else
image1.source = "";
panelLeft.visible = false;
buttonLeftMore.visible = false;
if(object2!=null)
//var widthImage2:Number = (width/2)-80;
//image2.width = widthImage2;
panelRight.visible = true;
buttonRightMore.visible = true;
image2.source = "file://" + File.applicationStorageDirectory.nativePath + "/b"+object2.idArchivo+"_500.jpg";
setObject2MainTexts();
else
image2.source = "";
panelRight.visible = false;
buttonRightMore.visible = false;
Whe I am in categoriesView i use the following code to pop(I USE PUSH INSTEAD OF POP DUE TO DIFFERENT OPTIONS I HAVE) the view from categoriesView to menuView.
protected function button1_clickHandler(event:MouseEvent):void
cleanMemory();
navigator.pushView(menuView);
private function cleanMemory():void
result.splice(0);
result = null;
System.gc();Hello,
I've the similar problem. I try to clean all objects, listeners and images. But i still have a memory leak.
Do you found a solution, Richard ?
Regards. -
Photoshop CS6 memory leak when idle and nothing open
Photoshop CS6 runs away with memory after being used and then going idle. If I open up PS and leave it, it will be ok but as soon as I open any file it will go up in memory usage (which is normal) but when I close all files and hide PS the memory will stay high never goes back down. When I close PS and re-open (no files open) again it idles at 300Mb memory but when I open a file then close it and then hide/idle PS it raises and stays around 1.25-1.5 GB if not more.
I have tried to Purge All, and even hide all menus to no avail. I have even tried to close Suitcase (eleminiate any font issues) and still same problem. I am running PS bone stock, no extra plug-ins.
Any ideas on why it would be doing this would be greatly appreciated!
My Computer:
Photoshop 13.0.1
MacBookPro
OS 10.6.8
CPU: 2.66 GHz Intel Core 2 Duo
Mem: 4 GB 1067 MHz DDR3
HD: 300GB (30GB Free)Photoshop is not supposed to free memory when you close documents -- that's normal, because the memory gets reused.
Yes, opening a file makes the memory usage go up - because space is needed for the document and it's window.
None of what you said describes a leak, and sounds like perfectly normal behavior.
Maybe you are looking for
-
Difference between IS NULL and = NULL
Hello Guys, In 10gR2 what is the difference between IS NULL and = NULL Thanks, Imran
-
Why does my MacBook Pro retina running 10.8.2 freeze upon wake?
This has happened at least twice: upon being awakened, the backlight of my MBP retina is on (the Apple logo is visible, but nothing is displayed on the LCD), the cursor is spinning but won't move, and touching the keyboard keys results in a system be
-
In finder, it says that I am shared to a pc which I didn't know about nor do i know the pc, how do I stop sharing with it?
-
Adding a vidio card for a hp palviloin 500-023w what is compatibale for me how many slots ?
adding a vidio card for a hp palviloin 500-023w what is compatibale for me how many slots ?
-
Working with Raw-need a conversion and image sizing program
Shot in Raw with Finepix S100. I need to convert to 16bit Tiff RGB and reduce image size to 4000x3000 for Final cut pro use. After converting my Raw to 16Bit-Tiff, my images are 5440x4080. FP does not like anything larger than 4000x3000 . The p