Sorry, having difficulty formattin code to appear correct here???
I am trying to understand the readings I get from running instruments
on my app which are telling me I am leaking memory.
There are a number, quite a few in fact, that get reported from inside
the Foundation, AVFoundation CoreGraphics etc that I assume I have no
contr...
I couldn't find any mention of this online... wouldn't putting a pointer in a struct be a bad thing? (at least in the modern object oriented programing) The programmer would inevitably creating a memory leak correct? (unless they, every time they use it, they disassociate the memory every time)
Assuming that the above is correct... is i...
Quick question: I am a C# guy debugging a C++ app so I am not used to memory management.
In the following code:
for(int i = 0; i < TlmMsgDB.CMTGetTelemMsgDBCount(); i++)
{
CMTTelemetryMsgCls* telm = TlmMsgDB.CMTGetTelemetryMsg(i);
CMT_SINT32_Tdef id = telm->CMTGetPackingMapID();
ManualScheduleTables.SetManualMsg(i,id);
...
Hi, im trying to get data via
NSString *string = [NSString
stringWithContentsOfURL: [NSURL
URLWithString: url]];
everything works fine, but when I run it with performance tool, it finds leaks on this line.
Here is whole mehod I use:
- (NSMutableDictionary *) getOutputImagesData: (URLParserImagesData) data
{
NSString *t...
Hi gurus, I've found a weird effect when trying to track down a memory leak in a Rails app. Can anyone explain what's going on here?
Save this script as a plain Ruby script (Rails not necessary):
class Fnord
def to_s
'fnord'
end
end
def test
f = Fnord.new
end
test
GC.start
sleep 2
ObjectSpace.each_object do |o|
...
Will it auto release when the user quit the application? or it will stay in the machine until reboot? Also, have Apple provides any tools for developer to check whether they release the object or not.
...
I am just getting started with cocoa. So please excuse the silly question, but I can't quite wrap my head around some aspects of memory management yet.
In the interface of my class I am declaring an object as CEMyObjectclass *myObject;. I do not alloc or init the obect in the classe's init menthod. But I do have a method that calls myOb...
All,
Over a period of time I have observed that fixing issues related to application crash is a discipline in itself. Some people have this nice way of attacking such problems. Ranging from Viewing the 'Event Viewer' to running Static/ Dynamic memory analysis tools to some of their 'personal favorites', these people have developed this ...
Dear everyone,
I have successfully debugged my own memory leak problems. However, I have noticed some very strange occurence.
for fid, fv in freqDic.iteritems():
outf.write(fid+"\t") #ID
for i, term in enumerate(domain): #Vector
tfidf = self.tf(term, fv) * self.idf( term, docFreqDic)
...
Would the code bellow cause my code to leak? More specifically, am I responsible for releasing the newImage or the contents of mainPageLayer (which is a CALayer object)? I get a memory warning every 4th time that method is called, but cant figure out why...
I also can't figure out why mainPageLayer.contents = [newImage CGImage]; throws ...
I want to extensively test some pieces of C code for memory leaks.
On my machine I have 4 Gb of RAM, so it's very unlikely for a dynamic memory allocation to fail. Still I want to see the comportment of the code if memory allocation fails, and see if the recover mechanism is "strong" enough.
What do you suggest ? How do I emulate an en...
Say for example i have the following code (pure example):
class a {
int * p;
public:
a() {
p = new int;
}
~a() {
delete p;
}
};
a * returnnew() {
a retval;
return(&retval);
}
int main() {
a * foo = returnnew();
return 0;
}
In returnnew(), would retval be destructed after the return of the funct...
Here is an (artificial) example of using a function that returns an anonymous struct and does "something" useful:
#include <iostream>
template<typename T>
T* func( T* t, float a, float b )
{
if(!t)
{
t = new T;
t->a = a;
t->b = b;
}
else
{
t->a += a;
t->b += b;
}
retu...
Hi,
I have a php script that runs a mysql query, then loops the result, and in that loop also runs several queries:
$sqlstr = "SELECT * FROM user_pred WHERE uprType != 2 AND uprTurn=$turn ORDER BY uprUserTeamIdFK";
$utmres = mysql_query($sqlstr) or trigger_error($termerror = __FILE__." - ".__LINE__.": ".mysql_error());
whil...
System.Reflection.Assembly.Load(System.IO.File.ReadAllBytes(path))
So this is a work around to not being able to use T4 to reflect or read other files in the project or solution without locking the binaries from this post. The comments imply a memory issue.
The comments talk about a no-unloading downside, would this be garbage collect...
I'm using Visual Studio 2008, Developing an OpenGL window. I've created several classes for creating a skeleton, one for joints, one for skin, one for a Body(which is a holder for several joints and skin) and one for reading a skel/skin file.
Within each of my classes, I'm using pointers for most of my data, most of which are declared u...
Hi,
I have a problem while scrolling images on tableview.
I am getting a Signal "0" error.
I think it is due to some memory issues but I am not able to find out the exact error.
The code is as follows,
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSStri...
Whilst developing for the iPhone I had a stubborn memory leak that I eventually tracked down to NSXMLParser. However whilst looking for that it got me thinking about maybe changing a lot of my convenience methods to alloc/release. Is there any good reason for doing that? In a large app I can see how releasing memory yourself quickly is a...
Can anyone tell me what I am doing wrong with the bottom section of code. I was sure it was fine but "Leaks" says it is leaking, which quickly changing it to the top version stops, just not sure as to why?
// Leaks says this is OK
if([elementName isEqualToString:@"rotData-requested"]) {
int myInt = [[self elementValue] intValue];
...
Hi all,
I'm stumped.
I'm trying to get a list of all the email address a person has.
I'm using the ABPeoplePickerNavigationController to select the person, which all seems fine. I'm setting my
ABRecordRef personDealingWith;
from the person argument to
- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)pe...