memory

Zend php memory memory_limit

All, I am working on a Zend Framework based web application. We keep encountering out of memory errors on our dev server: Allowed memory size of XXXX bytes exhausted (tried YYYY... We keep increasing memory_limit in php.ini, but it is now up over 1000 megs. What is a normal memory_limit value? What are the usual suspects in php/Ze...

understanding memory address

I am having problems with memory addressing in MIPS. It says that the addressing is word aligned... in the text below I don't understand why it's looking at the 2 least significant bits of the address? why? can someone give me an example to clarify/illustrate the point made here... so is it saying that a valid halfword address are all wh...

How to get a pointer value in Haskell?

I wish to manipulate data on a very low level. Therefore I've a function that receives a virtual memory address as an integer and "does stuff" with this memory address. I interfaced this function from C, so it has the type (CUInt -> a). The memory i want to link is a Word8 in a File. Sadly i have no idea how to access the pointer value t...

Best practice for PNG optimization?

I 'd like to prepare my PNGs for the best optimization, so I can get the best image quality (lossless if possible) and the smallest size. From what I understand, I should use: PNG, 72 dpi, RGB, but what else? Here is what we find in the iPhone HIG: Note:*The standard bit depth for icons and images is 24 bits (8 bits each for red, gree...

System.OutOfMemory being thrown. How to find the culprit?

I am using Visual C# Express 2008 and I have an application that starts up on a form, but uses a thread with a delegated display function to take care of essentially all the processing. That way my form doesn't lock up while tasks are being processed. Semi-recently, after going through a repeated process a number of times (the program p...

NSString stringByAppendingString memory issue

On objective-c with iPhone: I want to make a append with strings, but can I use autorelease? Is this right? NSString *str1 = [[NSString alloc] initWithString:@"STR1"]; NSString *str2 = [[NSString alloc] initWithString:@"STR2"]; NSString *s = [[str1 autorelease] stringByAppendingString:[str2 autorelease]]; will this remove the *str1...

Memory problems with NSMutableDictionary, causing NSCFDictionary memory leaks

Hi! Help me please with the following problem: - (NSDictionary *)getGamesList { NSMutableDictionary *gamesDictionary = [[NSMutableDictionary dictionary] retain]; // I was trying to change this on the commented code below, but did have no effect // NSMutableDictionary *gamesDictionary = [[NSMutableDictionary alloc] init]; // [g...

How do I disable history in python mechanize module?

I have a web scraping script that gets new data once every minute, but over the course of a couple of days, the script ends up using 200mb or more of memory, and I found out it's because mechanize is keeping an infinite browser history for the .back() function to use. I have looked in the docstrings, and I found the clear_history() func...

Oracle xmltype extract function never deallocate/reclaim memory until session down

Hi, I'm using Oracle 9.2x to do some xmltype data manipulation. The table as simple as tabls(xml sys.xmltype), with like 10000 rows stored. Now I use a cursor to loop every row, then doing like table.xml.extract('//.../text()','...').getStringVal(); I notice the oracle instance and the uga/pga keep allocating memory per execution of...

Reserve RAM in C

Hi I need ideas on how to write a C program that reserve a specified amount of MB RAM until a key [ex. the any key] is pressed on a Linux 2.6 32 bit system. * /.eat_ram.out 200 # If free -m is execute at this time, it should report 200 MB more in the used section, than before running the program. [Any key is pressed] # Now all the r...

Memory allocation in case of static variables

I am always confused about static variables, and the way memory allocation happens for them. For example: int a = 1; const int b = 2; static const int c = 3; int foo(int &arg){ arg++; return arg; } How is the memory allocated for a,b and c? What is the difference (in terms of memory) if I call foo(a), foo(b) and foo(c)? ...

Dynamically setting maximum heap size for java process

I have a Java program that is launched by a batch file with a line like this: javaw -Xms64m -Xmx1024m com.acme.MyProgram However, on some computers the program will not launch and displays the following message: Could not reserve enough space for object heap. Could not create the Java virtual machine. The problem seems to be t...

Memory allocation while insertion into a map

#include <stdio.h> #include <stdlib.h> #include <memory.h> #include <vector> #include <string> #include <iostream> #include <map> #include <utility> #include <algorithm> void * GetMemory(size_t n) { void *ptr = malloc(n); printf("getMem n %d ptr 0x%x\n", n, reinterpret_cast<unsigned int> (ptr)); return ptr; } void FreeMemory(vo...

Detect modification of variable at runtime in C/C++

Hello, I am developing a library in C++ where users/programmer will extend a class BaseClass that has a method initArray. This method should be implemented by the user/programmer and it should normally initialize all elements of the array m_arr. Here is a snipplet, modified to this example: class BaseClass { public: BaseCla...

Where to find the heap dump after an "Out Of Memory"

Hi! I'm using ASANT to run a xml file which points to a NARS.jar file. I'm getting "java.lang.OutOfMemoryError: Java heap space" and i'm researching around this. So i have found that i need to set "-XX:+HeapDumpOnOutOfMemoryError", to create a dump file to analyze. I edited ASANT.bat and added the "-XX:+HeapDumpOnOutOfMemoryError" to ...

[php] memory_get_usage

I'm making a little benchmark class to display page load time and memory usage. Load time is already working, but when I display the memory usage, it doesn't change Example: $conns = array(); ob_start(); benchmark::start(); $conns[] = mysql_connect('localhost', 'root', ''); benchmark::stop(); ob_flush(); uses the same memory as $conn...

IBM JRE 1.5 will not startup with the requested 1.5G memory

IBM JRE 5.0 on Windows, when given -Xmx1536m on a laptop with 2GB memory, refuses to start up: error message below. With -Xmx1000m it does start. Also, it starts fine with -Xmx1536m on other servers and even laptops, so I think that there is something more than just inadequate memory. Also, when started from within Eclipse (albeit, u...

browser memory increasing constantly with javascript ajax calls

Hi, I have a strange behaviour. I am using a rather heavy page (4000 nodes) meant to display a dispatch system for delivery operations. Every 30 sec. I am refreshing with jquery, the list of operations (3000 nodes over 4000). It works perfectly well, but... each time, the memory of both firefox and chrome is increasing by 3 to 6ko. Of c...

JBoss as a windows service. Where can i set the JAVA_OPTS?

hi. I'm running JBoss as a windows service, but i can't seem to find where i can configure the JAVA_OPTS to make it work properly. I need to set the Xms and the Xmx. I have tried to just run JBoss manually (run.bat) and in the same file i set the JAVA_OPTS= -Xms128m -Xmx512m. And that works. Here is my install.bat where i install the J...

Java VM - does the freed memory return to the OS?

In the Java runtime, if my application frees memory, does the runtime release the memory back to the OS? Or just back to my process? ...