memory

Tracking threads memory and CPU consumption

I'm writing a Linux application which observes other applications and tracks consumption of resources . I'm planning work with Java, but programming language isn't important for me. The Goal is important, so I can switch to another technology or use modules. My application runs any selected third party application as child process. Mostl...

Inheritance release order?

In my current test I have a class "PlanetClass" that inherits from "celestialClass". My question is when I release my "PlanetClass" object it goes through both dealloc methods, firstly releasing the Planet object and then the Celestial object. I added the dealloc to celestial to make sure I could release the iVar "bodyName", I think I ha...

Why does Psyco use a lot of memory?

Psyco is a specialising compiler for Python. The documentation states Psyco can and will use large amounts of memory. What are the main reasons for this memory usage? Is substantial memory overhead a feature of JIT compilers in general? Edit: Thanks for the answers so far. There are three likely contenders. Writing multiple spec...

How do programming languages handle huge number arithmetic

For a computer working with a 64 bit processor, the largest number that it can handle would be 2^64 = 18446744073709551616. How does programming languages, say Java or be it C, C++ handle arithmetic of numbers higher than this value. Any register cannot hold it as a single piece. How was this issue tackled? ...

What's the maximum memory footprint in MB for an typical iPhone app?

I know this is a subjective question. As far as I know, there are somewhat about 25 MB available for the app, but it depends on what else is going on. Currently playing music, a current phone call or what ever might drop that amount of memory down a lot. I don't know. Just tell us what you think, or what you have experienced. My app cur...

How to restrict the memory usage of Java application packed in a jar (-Xmx doesn't seem to work) on Windows

Hi, I'd want to restrict the maximum heap size for a Java application but it doesn't seem to work. I'm running the application from a jar package through bat in Windows. Bat contents: @Echo off set CLASSPATH=. java -Xmx32m -classpath %CLASSPATH% -jar MyApplication.jar This should restrict the maximum heap size of 32 megabytes. Howeve...

How much memory does a Java object use when all its members are null?

Is it correct to assume a Java object only takes up the 8 bytes for the object reference as long as all it's members are set to null or does the definition of members already use up space in the instance for some reason? In other words, if I have a large collection of objects that I want to be space efficient, can I count on leaving unu...

Can a System.AccessViolationException happen because of faulty RAM?

I have a website that i've been working on for about a year now. Recently, it's started throwing System.AccessViolationException every now and then, in my dev machine, mostly, when I was away from the machine... I haven't changed anything on the server code in weeks, since I've been working 100% on the Javascript part, and this error st...

Are MySQL databases with a MEMORY storage engine persisted to disk?

If MySQL databases with a MEMORY engine are stored in memory, does this mean that their contents are not persisted to disk? Or are they stored on HDD, but fully loaded into RAM on system power up? ...

Can a MySQL database be used in place of variables?

When I'm writing scripts in PHP to work with MySQL databases with a MEMORY storage engine, is it as fast as PHP variables? Can I consider using such a database in place of some variables for buffers, message queues, etc? ...

c++ operator overloading memory question

In c++ you can create new instances of a class on both the heap and stack. When overloading an operator are you able to instantiate on the stack in a way that makes sense? As I understood it an instance that sits on the stack is removed as soon as the function is done executing. This makes it seems as though returning a new instance sit...

How to predict the behavior of a system based on previous behavior

I am looking for an algorithm that, based on the previous behavior of a system, predicts the future behavior. I'm building a parallel memory allocator that has a public list of empty blocks. Each thread, when it needs, can take blocks from this list and allocate from them. The blocks are grouped in bins, depending on the allocation si...

PermGen problems with Lift and Jetty

I'm developing on the standard Lift platform (maven and jetty). I'm repeatedly (once every couple of days) getting this: Exception in thread "7048009@qtp-3179125-12" java.lang.OutOfMemoryError: PermGen space 2009-09-15 19:41:38.629::WARN: handle failed java.lang.OutOfMemoryError: PermGen space This is in my dev environment. It's not ...

Portable way to detect heap fragmentation in c++ at runtime?

I'm writing a qt-based c++ application and i need to be able to detect memory fragmentation in order to check if the current system can actually sustain the memory load: the program load a big image (15/21 megapixels are the norm) in memory and then perform some filtering on it (w/ sparse matrices). For instance, i'm having memory fragme...

ctypes memory management: how and when free the allocated resources?

I'm writing a small wrapper for a C library in Python with Ctypes, and I don't know if the structures allocated from Python will be automatically freed when they're out of scope. Example: from ctypes import * mylib = cdll.LoadLibrary("mylib.so") class MyPoint(Structure): _fields_ = [("x", c_int), ("y", c_int)] def foo(): p = ...

How Can I Prevent Memory Leaks in IE Mobile?

Hi All, I've written an application for use offline (with Google Gears) on devices using IE Mobile. The devices are experiencing memory leaks at such a rate that the device becomes unusable over time. The problem page fetches entries from the local Gears database and renders a table of each entry with a link in the last column of each ...

C++ struct alignment question

I have a predefined struct (actually several) where variables span across 32-bit word boundary. In Linux (and Windows using GCC) I am able to get my structs to pack to the correct size using 'attribute((packed))'. However I cannot get it to work the same way using VC++ and #pragma pack. Using GCC this returns a correct size of 6 bytes...

iPhone - dealloc subview UIViewController when removeFromSuperview

I have several buttons on my main UIViewController (main menu) that creates and adds a subview UIViewController on top of the main menu. When I remove the subview the memory from that controller is not released. How can I release that subviews memory instantly? Does anyone have an example? This would solve all my problems! Thanks in...

Can i limit apache+passenger memory usage on server without swap space

Hi, i'm running a rails application with apache+passenger on virtual servers that do not have any swap space configured. The site gets decent amount of traffic with 200K+ daily requests and sometimes the whole system runs out of memory causing odd behaviour on whole system. The question is that is there any way to configure apache or p...

iPhone - Multiple UIViewControllers Release

My main UIViewController, (PMGameViewController.h), is the file which my apps delegate calls. There are several buttons on my main UIViewController (PMGameViewController.m). When a button is pressed I do an insertSuvbiew and attach another UIViewController on top. When the mini game is over I simply do a removeFromSubview. This rem...