memory

Disappearing components??

Hi All, I have two problems that I have no idea how to fix... Flex. I have a canvas which contains a single myComponentA. A myComponentA contains a MyComponentB. The myComponentB contains a number of myComponentA's giving a tree structure...Ok so far. The structure is stored as an XML file. 1) When I load a big (60 or so components)...

How does Tomcat sandbox web apps?

I have a web app that is being served through Tomcat. My app lets users submit their own workflow which will then be executed on the server. My problem is how to control how much memory each user is taking up on the server. I think Tomcat itself runs apps in a sandbox of its own. I say this because when my app runs out of memory and cras...

memory layout c++ objects

Hi, I am basically wondering how C++ lays out the object in memory. So, I hear that dynamic casts simply asjusts the object's pointer in memory with an offset; and reinterpret kind of allows us to do anything with this pointer. I dont really understand this. Details would be appreciated! Thanks. ...

what is permsize in java

I was going through the document in Java Memory Management and in that I came across PermSize which I couldn't understand. The document says that it stores "JVM stores its metadata" but I couldn't exactly get what is meant by MetaData. I was googling and somewhere I read it stores value object( User defined object). Can any one explai...

Dynamic Allocation of Memory

How malloc call managed by user-library. I need the explanation of "How memory is being allocated in user space when malloc is called. Who manage it. Like sbrk() is called to enter in kernel space". ...

Using free inside the destructor of an object freed with delete

I'm having a little issue. I have an object that I'm freeing with delete, and it has a char* that's being freed with free in its destructor. The reason I'm using free is because I used strdup and malloc in creating the char pointers. The reason I'm using malloc is because I used strdup to begin with in most code paths. Would this scenari...

merge sort without extra memory

is there any condition in which merge sort can be done without extra memory my prof said it has and he will give bonus point on that. ...

Memory allocation, release and NSURLConnection in iPhone app

I'm hoping someone can help me with this. I'm struggling to find an answer to what should be an easy question. By the way, this is my first major obj-c project after years of using c and c# so feel free to point out things I'm failing on. I have an iPhone app designed to load an album of photos into a UIScrollView. It also has a rand...

Using C intrinsics and memory alignment difficulties with classes

Ok, so I am just starting to use C intrinsics in my code and I have created a class, which simplified looks like this: class _Vector3D { public: _Vector3D() { aVals[0] = _mm_setzero_ps(); aVals[1] = _mm_setzero_ps(); aVals[2] = _mm_setzero_ps(); } ~_Vector3D() {} private: __m128 aVals[3]; }; So far so good. But when I create a sec...

Why aren't these WCF related resources cleaned up?

Here is my scenario: Start my test program and immediately break into the debugger (WinDBG) Take a !DumpHeap -stat and observe there are no System.Net* or System.Xml* objects anywhere Create my WCF client, make a WCF request Close the WCF client and force GC. Take a !DumpHeap -stat and observer there are tons of System.Net*, System.Xml...

How are things stored in stack?

So I have been learning assembly and came to the topic of stack, storing local, static and global variable and stuff. But I'm having a hard time imagining it in my head. Bottom of memory but top of stack, :S whaa?? The thing that got me confused is, every time something gets push(ed) into stack, stack pointer gets subtracted. Shouldn'...

How to identify more than 4 gb ram on 32-bit machine

I know that a 32-bit OS cannot see more than 4 GB of RAM. So if I were to install, say, 6 GB of RAM on a machine running 32-bit OS, is there any way to identify that? I know one way to get the installed RAM is through WMI class: win32_physicalmemory.Capacity But I don't know if it'll show the correct installed ram size rather than suppor...

std::map, references, pointers and memory allocation

I am having a lil hard time with map and the valuetype allocation. consider this simple class: class Column { private: char *m_Name; public: // Overrides const char *Name(){ return this->m_Name; } // Ctors Column(const char *NewName){ this->m_Name = new char[strlen(NewName) + 1]; strcpy(this->m_N...

How do I ensure buffer memory is aligned?

I am using a hardware interface to send data that requires me to set up a DMA buffer, which needs to be aligned on 64 bits boundaries. The DMA engine expects buffers to be aligned on at least 32 bits boundaries (4 bytes). For optimal performance the buffer should be aligned on 64 bits boundaries (8 bytes). The transfer size must be a m...

Large dynamic array in c++

Short problem: #include <iostream> using namespace std; int main() { double **T; long int L_size; long int R_size = 100000; long int i,j; cout << "enter L_size:"; cin >> L_size; cin.clear(); cin.ignore(100,'\n'); cout << L_size*R_size << endl; cout << sizeof(double)*L_size*R_size << endl; ...

Dynamic memory allocation on stack

I recently tried this experiment in which instead of going for dynamic memory allocation for memory requirements of unknown size, I did a static allocation. When an array a[i] was declared by me, I kept i (size of the array) variable and dependent on the input that the user gives. #include <stdio.h> #include <stdlib.h> #include <stri...

C inline assembly memory copy

I am trying to write some inline assembly into C. I have two arrays as input, what I need is to copy one element in array1 into array2, and the following is what I have at the moment: asm ( "movl %0,%%eax;" "movl %1,%%ebx;" "movl (%%eax),%%ecx;" "movl %%ecx,(%ebx);" "xor %%ecx,%%ecx;" "movl 4(%%eax),%%ecx;" //do something on %ecx...

sizeWithFont memory leak in iphone

I have this code: [[data objectForKey:[keys objectAtIndex:0]] sizeWithFont:[UIFont systemFontOfSize:12] constrainedToSize:CGSizeMake(276.0, 1000.0) lineBreakMode:UILineBreakModeTailTruncation]; data is a NSDictionary. It is said this code has 16 bytes leak, but I cant find it. Help ...

C Memory Allocation: Why there is not enough memory(250K only)

Hi, I am having trouble figuring out the reason why my .c code is having trouble allocating ~250K of memory. Here is the allocation code: struct IMAGE { int width, height, maxval; char **data; }; void raiseError(char *msg) { printf("%s", msg); getch(); exit(1); } //... IMAGE readPGM() { IMAGE image; image....

Adding GUI components to a precompiled application.

iI there any way to add a GUI component to an application which is already running? I.E. Add an extra tab into a third party GUI? I have a third party application where I need to add an extra tab into the tabbed interface (or even a button to link to a new form). I can see the UI components in UISpy and Spy++ but Can't see a way to al...