Running Instruments on my iPad app found 2 leaks, except I cannot understand where they are coming from. The first one is in this method in my app delegate:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[window addSubview:self.viewController.view]; // <--- it leak...
I have an application deployed on Glassfish. Over time the number of loaded classes climbs into the millions and my permgen seems to rise.
To help troubleshoot I added the following to my jvm arguments.
-XX:+PrintGCDetails
-XX:+TraceClassUnloading
-XX:+TraceClassLoading
Now when watching the output, I see the same classes being loaded ...
I have this code:
void getStringWithTag(char* pFile, long sizeSound, char* tag, char* ret, float* currentPos){
char* tagCopy;
tagCopy = (char*)malloc(256 * sizeof(char));
int totalLen = 0;
int tempLen = 0;
memset(tagCopy, 0, 256);
memset(ret, 0, 128);
pFile += ((int)*currentPos);
while (totalLen+(*currentPos) < sizeSound) {
if (*pFi...
I am working on a large pre-existing system and can't use any of the external profiler tools that have been mentioned in other questions.
That being said, is there any programttic way for me to get java to print out what variables are still allocated and using heap space? Variable name and type would be ideal but any identifying variab...
Summary
I have written a process monitor command-line application that takes as parameters:
The process name or process ID
A CPU Threshold percent.
What the program does, is watches all processes with the passed name or pid, and if their CPU usage gets over the threshold%, it kills them.
I have two classes:
ProcessMonitor and Proce...
We're running a small web application written JRuby on Rails running under Tomcat. We're using a Spring back-end that's shared with another production web application. Unfortunately, we keep running into PermGen problems.
OS: Ubuntu Linux 2.6.24-24-server #1 SMP x86_64 GNU/Linux
Java: 1.6.0_21
Tomcat: 6.0.28
JRuby: 1.5.0
Rails: 2.3.7
W...
Hi,
I am trying to find leaks in my program, which is a framework based on Ogre3D. I am using the following defines in my code to 'new' anything so that later on any leak can be detected and reported correctly by the program.
#ifdef _DEBUG
#include <crtdbg.h>
#define MyFW_NEW new(_NORMAL_BLOCK ,__FILE__, __LINE__)
#define MyFW_...
Hi,
I am trying to wrap up some data from an array of BYTES into a VARIANT but I can't seem to free the data:
When I run this code...
SAFEARRAY * NewSArray;
SAFEARRAYBOUND aDim[1]; // a one dimensional array
aDim[0].lLbound = 0; //Sets the index to start from 0
//Sets the number of elements (bytes) that will go into the SAFEARRAY
aD...
i have a socket server written in java, and i believe there is a memory leak. The i could not find anything in Netbeans' profiler, so i want to test it when it in deployed on my ubuntu server. How do i do this? What is an easy to install and use java profiler for ubuntu?
...
I have a CoreData NSManagedObject subclass, TextNarration, that has an attribute of type NSString, textURI. That class implements the NSCoding protocol methods: initWithCoder and encodeWithCoder this way:
- (id) initWithCoder: (NSCoder *)coder
{
if (self = [super init])
{
self.textURI = [coder decodeObjectForKey:@"te...
Hello,
I just spent a whole week tracking down and whacking memory leaks over the head, and I arrived on the other end of that week a little dazed. There has to be a better way to do this, is all I can think, and so I figured it was time to ask about this rather heavy subject.
This post turned out to be rather huge. Apologies for that,...
Can you tell me is there any thing wrong in the code, my application is crashing randomly
I cannot find any possible logical or memory error, please help as this is going out of my scope.
#define __FN__ "CGD9_gd_ParseAddFieldsProC"
int CGD9_gd_ParseAddFieldsProC (CGD_gd_ParseAddFields_Iparam_t *i_param_st_p)
{
t_gd9adfld_t *p_ext_fi...
All right, you guys were very helpful with my last question, so I'll try another one. This is also homework and while the last one was quite old, this has been submitted and is waiting to be marked. So if there's anything that will bite me it'll probably be this problem. I've obfuscated the class names and such since it's still possible ...
I have a TabControl which is having 2 TabItems. Each of these two TabItems is having a listbox. On the SelectionChanged event handler I am setting ItemSource property of the appropriate ListBox to null and populating the other one with a Collection. Now when I keep on selecting each Tab there is a memory spike. What may be the possible r...
Hi there,
I am having problem finding a memory leak with Instruments. Usually it helps me a lot and I am able to find the leak, but in this case I'm lost.
I am creating a view controller that controls a views loaded from NIB file. The view has Map View with "Show user location" on true. Once user location is found I use MKReverseGeocod...
I have 2 arrays, 1 in the viewDidLoad method and 1 in the add method(adds an object to favorites)
NSUserDefaults *myDefault = [NSUserDefaults standardUserDefaults];
NSArray *prefs = [myDefault arrayForKey:@"addedPrefs"];
userAdded = [[NSMutableArray alloc] initWithArray:prefs];
Instruments is showing leaks from these prefs NS...
I have a leak in my initWithCoder.
Can anyone help me see what's wrong?
In my custom classes I have tried both using self. and without...
-(id) initWithCoder: (NSCoder *) decoder {
if( self = [super init] )
{
persons = [[decoder decodeObject] retain];
title = [[decoder decodeObject] retain];
}
return ...
Hello,
I am getting close to finishing the release of my application and are trying to use Instruments to fix any memory leaks.
How come that I can spot one memory leak when using Instruments and my device but not when I am using the iPhone simulator? I understand that this is a high-level question, but I don't think posting any code ...
Hi,
My controller get data from function in delegat:
- (NSArray *)getChapters {
NSMutableArray *list = [[NSMutableArray alloc] init]; //memory leak
if (chapter_statement == nil) {
const char *sql = "SELECT DISTINCT 'Глава '||chapter FROM verses WHERE book=? ORDER by chapter";
if (sqlite3_prepare_v2(database, sql, -1,...
We're running a small JRuby on Rails app under Tomcat 6.0.28 with a Spring-based backend. I've spent some time with the Eclipse Memory Analysis tool and I can definitely tell that instances of the JRubyClassLoader are leaking. I setup our webapp to only use a single JRuby runtime and then I effectively did a hot-deploy to Tomcat by touch...