memory

android finish() method doesnt clear app from memory

Hi I have an activity and I call the finish() method and the activity is not cleared from memory. After calling finish() , I see that the method onDestroy() is executed successfully (and I clear all my variables and stuff in there). Should it be cleared from memory or its how android works? As I understand the LifeCycle of the Activit...

Memory efficiency vs Processor efficiency

In general use, should I bet on memory efficiency or processor efficiency? In the end, I know that must be according to software/hardware specs. but I think there's a general rule when there's no boundaries. Example 01 (memory efficiency): int n=0; if(n < getRndNumber()) n = getRndNumber(); Example 02 (processor efficiency):...

Dynamically allocate C struct?

Hi, I want to dynamically allocate a C struct: typedef struct { short *offset; char *values; } swc; Both 'offset' and 'values' are supposed to be arrays, but their size is unknown until runtime. How can I dynamically allocate memory for my struct and the struct's arrays? ...

make full use of 24G memory for jboss

we have a solaris sparc 64 bit running the jboss. it has 24G mem. but because of JVM limitation, i can only set to JAVA_OPTS="-server -Xms256m -Xmx3600m -XX:MaxPermSize=3600m". i don't know the exactly cap. but if i set to 4000m, java won't like it. is there any way to use this 24G mem fully or more efficiently? if i use cluster on on...

Php CLI script ignoring memory_limit, crashing at much lower number than limit

Hello, for some reason, my one of my php scripts are ignoring the php.ini memory limit or ini_set. When i do a print_r(ini_get_all) it shows the global memory limit set to 100M (and local for that matter), when my script dies at Fatal error: Out of memory (allocated 24714304) (tried to allocate 571 bytes) Any tips on diagnosing this?...

Delphi: storing data in classes vs records, memory usage reduction

Hi, I have quite a lot of data to store, read and modify in memory while the application works. The data could be compared to a tree, where each node is described by limited number of strings and integers, and has quite a lot of subelements. Currently the data is stored using classes/objects, like TRootElement = class fName, fDescripti...

Profiling C++ with Xcode

Hi, is it possible to profile C++ apps with Xcode so one gets; memory leaks like with valgrind possible errors before running the program Thanks, I am very new to mac and xcode Where can one find a good tutorial for this? ...

How to handle realloc when it fails due to memory?

Question says it all but here is an example: typedef struct mutable_t{ int count, max; void **data; } mutable_t; void pushMutable(mutable_t *m, void *object) { if(m->count == m->max){ m->max *= 2; m->data = realloc(m->data, m->max * sizeof(void*)); } // how to handle oom?? m->data[m->count++] = ...

What happens if your asp.net app is using too much memory?

Lets say that you are using a shared hosting plan and your application stores lots of objects in the application state. If they start taking too much memory does this mean that the server will just remove them? If not what will happen then? What happens when the server has no memory left? Can you still store objects into the applicati...

How is it possible to access memory of other processes?

I thought that one processes cannot read the memory of another process. But I'm shocked to see an application named "WinHex" which has "Ram Editor" and it is able to access entire memory. of all the processes. How is that possible? And it is even able to modify the memory of other processes. Doesn't this become malicious? ...

PHP Out of Memory - Crashes Apache?

Hello all, I am running PHP version 5.3.0 and Apache: 2.2.11 When I run PHP scripts that consume a lot of memory (I think) - large loops etc. My Apache web server reports a crash?! [Sat Jan 02 00:51:30 2010] [notice] Parent: child process exited with status 255 -- Restarting. Do I need to increase memory somewhere? I currently have ...

memory overhead of pointers in c/c++

I'm on a 64bit platform, so all memory adrs are 8 bytes. So to get an estimate of the memory usage of an array, should I add 8 bytes to the sizeof(DATATYPE) for each entry in the array. Example: short unsigned int *ary = new short unsigned int[1000000]; //length 1mio //sizeof(short unsinged int) = 2bytes //sizeof(short unsinged int*)...

Delphi, string vs widestring memory usage issue, non-unicode VCL (D7)

Hi, I'm storing some classes with WideString parameters describing them (like name, description and some others). Now if I change all those WideStrings to simple "string" (I'm using alias actually so I have to change one line only), memory usage is about 5% bigger!! than previously... How is that possible, since each char of the string i...

Memory related errors

Hello, I mostly work on C language for my work. I have faced many issues and spent lot time in debugging issues related to dynamically allocated memory corruption/overwriting. Like malloc(A) A bytes but use write more than A bytes. Towards that i was trying to read few things when i read about :- 1.) An approach wherein one allocates m...

There is insufficient system memory in resource pool 'default' to run this query.

I'm getting this error: There is insufficient system memory in resource pool 'default' to run this query. I'm just running 100,000 simple insert statements as shown below. I got the error approx on the 85,000th insert. This is a demo for a class I'm taking... use sampleautogrow INSERT INTO SampleData VALUES ('fazgypvlhl2svnh1t5di','...

How to write a thread-safe and efficient, lock-free memory allocator in C?

How to write a thread-safe and efficient, lock-free memory allocator in C? By efficient I mean: Fast allocation & deallocation Optimal memory usage (minimal wastage and no external fragmentation) Minimal meta-data overhead ...

How to change the allowed amout of allocated memory?

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 40000 bytes) in /mounted-storage/home20a/sub001/sc20063-GJYD/[...] on line 62 It looks like the PHP-script only allowes me to allocate 32 MB to the memory? This was with an example image to test what would happen if a user tries to upload a huge picture. My...

Which way to reserve memory for a string?

I have created a macro to make reserve memory for my strings in C. It looks like this: #define newString(size) (char*)malloc(sizeof(char) + size) So is there any reason I shouldn't use this macro in my own personal projects? I know I shouldn't do this in production code because it would require everyone to have that header file and ev...

DotNET project resources and memory, what's going on?

Where can I find reliable information regarding project resources and memory? I'd like to know when resources are loaded into memory from the dll, when they are removed by the GC etc. Reason is my app carries the help-file topics as HTML-Strings inside the source, and I'm about to add the possibility to include images. I don't care if m...

Pointer address in a C multidimensional array.

Hi, I'm messing around with multidimensional arrays and pointers. I've been looking at a program that prints out the contents of, and addresses of, a simple array. Here's my array declaration: int zippo[4][2] = { {2,4}, {6,8}, {1,3}, {5,7} }; My current understanding is that zippo is a pointer, an...