Hai Guys,
I am getting the leaks as 100%. I don't know how to release the object after it returns
Could you explain the procedure how to release the allocated Titles object.
-(Titles *)listTiles
{
Tiles* tile = [[Tiles alloc] init];
tile.googleTile_X = (int)tileX;
tile.googleTile_Y = (int) pow(2, aZoom) - 1- tileY ;
tile.zoomLevel ...
I have few questions regarding java GC and memory management.
In java we define process memory upper bound and lower bound by xmx and xms parameters. Using these parameters JVM allocates young old and perm space. So if new threads are created then from which memory do stacks memory is allocated to threads? is it from perm space or any ...
NSArray *tLines = [[NSArray alloc] initWithObjects:
[[NSArray alloc] initWithObjects:@"Matt", @"David", nil],
[[NSArray alloc] initWithObjects:@"Bob", @"Ken", nil], nil];
self.lines = tLines;
[tLines release];
I'm allocing NSArrays within an NSArray, will the nested arrays get released when I call ...
In java we can define max memory that process can take using xmx parameter. For perm gen we can define the MaxPermSize. So is the perm gen space is also part of memory allocated using
xmx parameter.
so is xmx = young + old OR young + old + perm OR young + old + perm + Stack space ?
...
are the new objets assigned from eden space or eden + fromSurvivor space ?
can free space in from survivor space be also used for allocation to new objects ?
EDIT :
consider the scenerio :
suppose Eden space is full and from survivor space occupancy is less, then in that case if new object is created (new object is small enough to fit...
Just to test, I ran this code
#include<unistd.h>
#include<stdio.h>
#include<stdlib.h>
int main() {
int **ar = (int**) malloc(100000000* sizeof(int*));
int i;
for(i = 0; i<10000000; i++) {
ar[i] = (int*) malloc(1000 * 4);
ar[i][123] = 456;
}
usleep(3000000); usleep(3000000);
usleep(3000000); us...
I have a class, that basically manages core data. inserts deletes and updates data.
I initialize this class like so
- (id)init
{
self = [super init];
if (self) {
self.itemList = [NSDictionary dictionaryWithObjectsAndKeys: // <== LEAKS
ITEMURL1, KEY1,
ITEMURL2, KEY2,
...
Is a "static final" directly allocated into young gen or old gen or perm gen? (I guess it will most likely land into old gen over the time I suppose.) If it is allocated in the perm gen then, will it be garbage collected when class unloading takes place in Perm Gen ?
...
When a page fault exception is raised because the content CPU is trying to access have not been loaded in to memory, how does the OS locate the missing content on the secondary storage (e.g. hard disk)?
Thanks for your explanation in advance.
-ivan
...
[1] states:
"When data is deleted from a heap, the data on the page is not compressed (reclaimed). And should all of the rows of a heap page are deleted, often the entire page cannot be reclaimed"
"The ALTER INDEX rebuild and reorganize options cannot be used to defragment and reclaim space in a heap (but they can used to defragmen...
We occasionally come into this error when running a EXE on windows.
How does OS know if a specific memory can be read or not?
...
Hi everybody,
I have the problem that memcpy/memmove change the pointer of a struct FOO foo, which is neither src nor destination of the function. Here are the gdb outputs:
Before memmove(y,y_temp,size_y);:
(gdb) p y
$38 = 0xbff7a2e0
(gdb) p y_temp
$39 = (float *) 0x815ea20
(gdb) p foo
$40 = (FOO *) 0x81d4e90
and after:
(gdb) p y_t...
In Java, finalize is called on an object (that overrides it) when it's about to be garbage collectioned, so when it's unreachable. But what if the finalizer makes the object reachable again, what happens then?
...
I feel like I don't understand something fundamental here. I've been working on memory management in my app while using Instruments to check out live allocations. I have a modal view controller (settingsViewController) that has an image for a background. One thing I noticed was that even after settingsViewController dealloc is called,...
How many bytes does memory arbiter protect?
While reading "Understanding the linux kernel, 3rd edition" chapter 2, section2.1, I encounter the following statement:
In multiprocessor systems, all CPUs usually share the same memory; this means that RAM chips may be accessed concurrently by independent CPUs. Because read or write operation...
Okay, I've written my first functional PHP extension. It worked but it was a proof-of-concept only. Now I'm writing another one which actually does what the boss wants.
What I'd like to know, from all you PHP-heads out there, is whether this code makes sense. Have I got a good grasp of things like emalloc and the like, or is there stuff...
Hi.
I got the "objc_msgSend()" killer error message in my app and thanks to Hamster Emporium
i can figure out a little bit what was happening.
Now i found the "problem" and the "solution", but what i can't understand why my problem was really a problem.
Here is the scenario:
Object_A --> Object_B --> Object_C
The '-->' symbol re...
Just when I thought I've understood this topic completely, I'm back to basics.
I have a method that instantiates an autoreleased object, using (for example) stringWithFormat:
return [NSString stringWithFormat:@"what"];
Then I call this method from another method, and another method, each time returning this autoreleased NSString and ...
Consider,
pageContext.setAttribute("name", new String("Shal"));
String name1= new String("Jason");
pageContext.setAttribute("Alternate Name", name1));
how the memory is allocated for the above two attributes,how and when that memory allocated will be recovered. What is the best practice to follow
...
While reading answers to this question I noticed that answers (this for example) imply that operator delete can be called even when delete statement is executed on a null pointer.
So I wrote a small snippet:
class Test {
public:
void* operator new( size_t ) { /*doesn't matter*/ return 0; }
void operator delete( void* ptr ) {
...