Skip to main content

Posts

Showing posts with the label memory

How to tune Tomcat 5.5 JVM Memory settings without using the configuration program

I need to configure Tomcat memory settings as part of a larger installation, so manually configuring tomcat with the configuration app after the fact is out of the question. I thought I could just throw the JVM memory settings into the JAVA_OPTS environment variable, but I'm testing that with jconsole to see if it works and it... doesn't.

Memory consumption issues of a Java program

I have a Java program that runs on my Ubuntu 10.04 machine and, without any user interaction, repeatedly queries a MySQL database and then constructs img- and txt-files according to the data read from the DB. It makes tens of thousands of queries and creates tens of thousands of files.

UIWebView - When (or how) does CFData get released?

after multiple days of banging my head against the wall and having sleepless nights I'm hoping to find some help here. I've gone through various posts here, but none of the answers seem to provide a resolution for me. In short, my problem is that my App crashes after heavy usage (>10min) of the UIWebView (e.g. opening larger news paper sites in series - one after the other). To give more details: I am writing an iPhone App and from the MainViewController I push a browserViewController on the navigationController. The browserViewController loads a nib which contains a UWebView (I do not create the WebView programatically). The UIWebView is wired up using Interface Builder. When going back to Main and then going again to the browserViewController, I only recreate the browserViewController if it is nil. (I want to keep the content that is loaded i the UIWebView - only if there is a memory warning shoud this view be unloaded and release all memory used). In both, MainV

Detect application heap size in Android

How do you programmatically detect the application heap size available to an Android app? I heard there's a function that does this in later versions of the SDK. In any case, I'm looking for solution that works for 1.5 and upwards. Source: Tips4all

Why does java wait so long to run the garbage collector?

I am building a Java web app, using the Play! Framework . I'm hosting it on playapps.net . I have been puzzling for a while over the provided graphs of memory consumption. Here is a sample: The graph comes from a period of consistent but nominal activity. I did nothing to trigger the falloff in memory, so I presume this occurred because the garbage collector ran as it has almost reached its allowable memory consumption. My questions: Is it fair for me to assume that my application does not have a memory leak, as it appears that all the memory is correctly reclaimed by the garbage collector when it does run? (from the title) Why is java waiting until the last possible second to run the garbage collector? I am seeing significant performance degradation as the memory consumption grows to the top fourth of the graph. If my assertions above are correct, then how can I go about fixing this issue? The other posts I have read on SO seem opposed to calls to System.gc()

Size of a byte in memory - Java

I have heard mixed opinions over the amount of memory that a byte takes up in a java program. I am aware you can store no more than +127 in a java byte, and the documentation says that a byte is only 8 bits but here I am told that it actually takes up the same amount of memory as an int, and therefore is just a Type that helps in code comprehension and not efficiency. Can anyone clear this up, and would this be an implementation specific issue?

MapView and dealloc IOS

Hello i have a mapView and i think it takes too much memory after leaving the mapView here are my methods is anything missing? - (void)viewDidUnload { mapView.showsUserLocation = NO; b [mapView removeAnnotations:mapView.annotations]; [super viewDidUnload]; } -(void)dealloc{ [name release]; [type release]; [address release]; mapView.delegate = nil; [super dealloc]; } - (void)viewDidLoad{ foundLocation = location found <---- MKCoordinateRegion region; region.center.latitude = foundLocation.coordinate.latitude; region.center.longitude=foundLocation.coordinate.longitude; region.span.longitudeDelta=0.01; region.span.latitudeDelta=0.01; [mapView setRegion:region animated:NO]; ann = [[MapAnnotation alloc]init]; ann.title = name; ann.subtitle = type; ann.coordinate=region.center; [mapView addAnnotation:ann]; [ann release]; self.navigationItem.title=@"Map"; [super viewDidLoad]; } The

Writing huge string data to file in java, optimization options

I have a chat like desktop java swing app, where i keep getting String type data. Eventually the String variable keeps growing larger and larger. 1) Is it wise idea to keep the large variable in memory and only when the logging is finished save this to disk. 2) If not, then should i continue saving everytime i get a new string (of length about 30-40). How should i go about optimizing such a desgin?