memory

How can I edit individual pixels in a window?

I want to create a simple video renderer to play around, and do stuff like creating what would be a mobile OS just for fun. My father told me that in the very first computers, you would edit a specific memory address and the screen would update. I would like to simulate this inside a window in Windows. Is there any way I can do this with...

Programmatically find how much RAM available

Is there a portable way, that works on both .Net and Mono on the various supported operating systems, for a program to tell how much RAM (i.e. physical not virtual memory) is available in the machine it's running on? The context is a program whose memory requirement is "as much as possible please"; it needs to know how much memory it sh...

Why does this Java/Groovy code cause heap memory exceptions?

Hi, This 3rd party script keeps causing heap memory exceptions: byte[] forwardMessage(byte[] content) { s = new Socket("172.17.0.30", 10001); s.withStreams {InputStream input, OutputStream output -> output.write content return readRtsData(input) } } byte[] readRtsData(input) { def vplEndByte = 0xff ...

Do something just before running out of memory

Is there a way in Java to do something just before running out of memory. For example, keeping a list of previous document states (for undo) and only removing very old states when memory is about to be exhausted? ...

In C, is it necessary to free a pointer at exit?

Possible Duplicate: When you exit a C application, is the malloc-ed memory automatically freed? In C, is it necessary to free a pointer at exit? When the program exists, does it free memory from pointers still pointing to an allocated block? Is it dependent on the OS? ...

Returning local data from functions in C and C++ via pointer

I have argument with my friend. He says that I can return a pointer to local data from a function. This is not what I have learned but I can't find a counterargument for him to prove my knowledge. Here is illustrated case: char *name() { char n[10] = "bodacydo!"; return n; } And it's used as: int main() { char *n = name(...

Why Would an Out of Memory Exception be Thrown if Memory is Available?

I have a fairly simple C# application that has builds a large hashtable. The keys of this hashtable are strings, and the values are ints. The program runs fine until around 10.3 million items are added to the hashtable, when an out of memory error is thrown on the line that adds an item to the hasbtable. According to the task manager, ...

How do I make Python remember settings?

I wrote the beautiful python example code below. Now how do I make it so when I exit then restart the program it remembers the last position of the scale? import Tkinter root = Tkinter.Tk() root.sclX = Tkinter.Scale(root, from_=0, to=1500, orient='horizontal', resolution=1) root.sclX.pack(ipadx=75) root.resizable(False,False) root.t...

what is the maximum heap size and stack size supported by iphone os?

Hi Could anyone tell me what is the maximum application size supported by iphone? Also what is the maximum heap size and stack size supported? Application goes 'out of memory' very soon... ...

Understanding Memory Usage

Hello, I have a windows service that runs 24x7 and the memory usage climbs steadily and about once a week we have to restart it. I'm looking for information on understanding memory usage in .NET so that I may get a clear understanding of why our service is doing this. I'd also like to gain a better understanding of this in .NET going f...

How to recreate views released when memory warning is received.

If an application receives a low memory warning and a view controller releases the view, how does one reload the view the next time it's needed. I have my views defined in a .xib file and on earlier iphones, the views are being set to nil. Where/when/how do I recreate these views if they are removed? ...

Is it possible to read the memory of a running java application?

I'd like to learn how, or if its possible at all to programmaticly interact with a black-box java application(by reading its data). Has there been any previous research/work on doing this sort of thing? I'd imagine that running on a JVM significantly complicates things. @anon: Doing this with any JVM is relevant. Do you have to kno...

address space Library or Process

Hi, I have one basic doubt. I have a process which uses a shared library. If I am allocating some memory in the library then which address space it is. (Library or Process) In my opinion it is the process address space because once the library is attached it is all in process address space. Please correct me if I am wrong. Thanks Arpi...

BitSet memory usage in Scala

I would like to know what is the memory usage of BitSet in Scala.For example, if I do: var bitArray:BitSet=new BitSet(10) bitArray.add(0) bitArray.add(2) bitArray.add(4) bitArray.add(6) bitArray.add(8) How does that compare with and array containing the even numbers 0,2,4,6,8? What about writing a number in binary: var...

iphone: memory question

Hello, Still new to the memory management in iPhone apps, I have a newbee question. Let say I have some method that use attributes of the AppDelegate. At the beginning of those methods, I get the delegate like: // Get delegate MyAppDelegate *delegate = (MyAppDelegate *)[[UIApplication sharedApplication] delegate]; Do I need to perform...

Python: get number of items in generator without storing the items

I have a generator for a large set of items. I want to iterate through them once, outputting them to a file. However, with the file format I currently have, I first have to output the number of items I have. I don't want to build a list of the items in memory, as there are too many of them and that would take a lot of time and memory. Is...

Java application memory usage

Hello all. I have been writing a small java application (my first!), that does only a few things at the moment. Currently, it runs the Main class which launches a gui class (a class I wrote that extends JFrame that only contains a JTextArea), a class that loads a local file through a BufferedInputStream that is approximately 40kb, and ...

Cocos2d-iphone,not calling dealloc when replacing scene

This is a simplified version of the problem I'm facing now. I've made 2 empty CCScene 1 & 2 and added CCLayer 1 & 2 onto their respective scene. I also added an touches function to switch from scene 1 to scene 2 using CCDirector's replacescene. However, dealloc was never called during the replace scene. // scene & layer 2 are exactly t...

Allowed memory size error

Hi, I have programmed one hand and tossed it on my host's server but get the error here Fatal error: Allowed memory size of 536870912 byte exhausted (tried to allocate 4294967296 bytes) This is my code <?php require 'opsatning/top.php'; ?> <!--[if IE]> <style> .arrow { top: 100%; }; </style> <![endif]--> <div id="content_indhold"> <?...

Program just filled up my memory and started filling up swap in Xubuntu

Is there a way to find out what process or what is filling up the memory? I just wrote a program that seems to fill it up rather quickly and not release it afterwards. Thanks in advance! ...