memory

Swap space in 64 bit Linux

Hi All, I have a 64 bit Linux (SUSE 10) dual processor. When I run my process it uses around 4 G of virtual memory. Only 3G is resident memory. Rest around 9G memory is free. How to load this 1 G also in RAM? Why it is still in swap space why kernel can't load this into RAM when all the RAM is available. Rahul ...

Sparse linear algebra solvers for C#

I'm working on an experimental implementation of Goldenthal et.al's inextensible cloth algorithm in C#. First I used Math.NET Iridium to assemble and solve the matrices, but quickly replaced this with dnAnalytics since the latter allows me to reuse matrices, almost eliminating further memory allocation, which is important for real-time...

Is there a Perl statistics package that doesn't make me load the entire dataset at once?

I'm looking for a statistics package for Perl (CPAN is fine) that allows me to add data incrementally instead of having to pass in an entire array of data. Just the mean, median, stddev, max, and min is necessary, nothing too complicated. The reason for this is because my dataset is entirely too large to fit into memory. The data sourc...

Defining String Literals?

Can anyone confirm this for me ... NSString *testString = @"Betty"; By my way of thinking this line is declaring the NSString pointer (*testString) to point to the string literal @"Betty". This declaration does not need an alloc, nor does it need to be released? I just want to make sure I am on the right track. -gary- ...

WPF-application memory leak

Hello. After certain action (pressing a button that starts a sequence of calculations) in the WPF-application a memory leak occurs (it is visible in the task manager in vm size section) approximately on 10 mbytes after each pressing of the button. The sequence of calculations does not contain errors. The use of memory profiler (.NET Memo...

Getter Sequence Of Events?

I am trying to understand what is happening in the getter below, this is what I understand so far: (1) the getter returns a pointer to an NSString object. (2) the NSString object is retained, possibly because we have just given away a pointer to it. (3) autorelease? when does that activate, when the PlanetClass instance is deallocated (...

Language features: optimizing booleans to flags + bitmasks.

I'm writing a programming language, and when I came across this question, my immediate thought was that languages should optimize booleans into bit flags for the programmer. This would keep all the benefits of speed and efficient memory usage while removing the burden of maintenance and the possibilities for errors caused by the more co...

Can you send retain counts to NSLog to aid learning?

Just curious if there is anyway to display an objects retain count using NSLog. I just want to print them out to console to help learn how retain/release is working in some simple code? cheers -gary- ...

How to quickly zero out an array?

I am currently doing it in a for loop, and I know in C there is the ZeroMemory API, however that doesn't seem to be available in C#. Nor does the somewhat equivalent Array.fill from Java exist either. I am just wondering if there is an easier/faster way? ...

Tomcat ThreadWithAttributes causing Memory Leak

I have out of memory issues with following environment: Tomcat 5.1.23 Using XFire WebServices Framework JDK 1.5 Used YourKit to profile it and found out multiple instances of class org.apache.tomcat.util.threads.ThreadWithAttributes has huge ArrayList object (Stack Local) with java.lang.Object array containing duplicate string. Follow...

VB.NET Memory Management

Update: I probably confused memory usage issues with the UI sharing same thread as the processing (as pointed out by MusiGenesis below). However regarding the Memory usage. I am still not able to find VB.net specific syntax, although people have pointed out some great .Net and C# information below (and if I were more versed in those te...

Class Instance Release Order?

This is probably a pretty basic question, but just something that I wanted to make sure I had right in my head. When I release the class instance "newPlanet_001" what is the order of disposal, Am I right in assuming that if the retain count of the object is 1 prior to the release that the instances dealloc method is called first (to rel...

Python memory leaks?

I am writing a python extension that seems to be leaking memory. I am trying to figure out the soure of the problem using valgrind. However, it seems that python itself is leaking memory according to valgrind. Using the following simple script: hello.py print "Hello World!" and doing > valgrind --tool=memcheck python ./hello.py...

When are released objects finally destroyed?

When you release an object in Objective-C (assuming its release count is 1) its release count is decremented to 0 and the dealloc method called. Is the object destroyed right there and then after the [super dealloc], or is it added to the pool and destroyed when the pool is drained? I would assume that released objects are destroyed at ...

Is it possible to check whether an OpenGL ES texture on iPhone has been truly deallocated?

The manual just instructed you to write: glDeleteTextures(1, &GLtexture); and claims that the texture will be deleted. iPhone has scarce memory and I want to ensure that these textures are truly released. The Leaks instrument cannot detect this, and frankly, I am a bit worried. I do really want to make sure that the textures are rea...

Prevent many different MVC URLs from filling ASP.NET Cache

Our website uses ASP.NET MVC for a part of the pages in it. These URLs typically have the form http://oursite/detail.mvc/12345/pictures/ In this URL, the 12345 is an ID in the database. We have several hundred thousands objects for which we show detail pages. Recently we noticed a rise in the memory use for the site, so I investigated a ...

Is there a caching penalty for mixing binary data and instructions within close proximity of each other?

I'm procedurally generating 128-byte blocks with some set n-byte header reserved for machine-language functions that I'm simply calling via in-line assembly. They aren't defined anywhere and are generated at run-time into pages allocated into memory with access for execution. However, I want to reserve the end (128 - n) bytes of these ...

Increasing PHP memory_limit. At what point does it become insane?

In a system I am currently working on, there is one process that loads large amount of data into an array for sorting/aggregating/whatever. I know this process needs optimising for memory usage, but in the short term it just needs to work. Given the amount of data loaded into the array, we keep hitting the memory limit. It has been incr...

Any function to query the size of an allocated block?

I realize that any such function is likely to be non standard, but that's ok for my use case. Basically, I need a method (even if it's only exposed through glibc's syscall() interface) that I can pass a pointer to (a pointer that was returned by a previous call to malloc()) that returns the size of the block the pointer points at. Does s...

iPhone - CGBitmapContextCreateImage Leak, Anyone else with this problem?

Has anyone else come across this problem? I am resizing images pretty often with an NSTimer. After using Instruments it does not show any memory leaks but my objectalloc just continues to climb. It points directly to CGBitmapContextCreateImage. Anyone know of a solution? or Even possible ideas? -(UIImage *) resizedImage:(UIImage *)i...