memory-usage

Cocoa memory management, why does my app keep using more?

I made a xfire client for mac (called BlackFire -> http://www.macxfire.com) and it keeps using more and more ram over time, even when not doing that much. I have run the app with instruments::leaks and it doesn't show any leaks at all (when it did i fixed them quickly). Somehow it still keeps using more ram, like it is supposed to or so...

functions returning char pointer

I came across lot of functions returning char pointers in one legacy application. Some of them returning pointers to local character arrays. It seems to be causing crashes after several invocations(not immediately!) see the usage below char *f1(){ char buff[20]; char *ptr; ---- ---- ptr=buff; return ptr; } --- --- f2(f1())...

How to measure the total memory consumption of the current process programatically in .NET?

How to measure the total memory consumption of the current process programatically in .NET? ...

UIButton setBackgroundImage consumes a lot of memory

I'm using the following code: UIImage *buttonImage; if (p.placeImage != nil) { buttonImage = [UIImage imageWithData:p.placeImage]; } else { buttonImage = [UIImage imageNamed:@"bg_place_noimg.png"]; } [imageButton setBackgroundImage:buttonImage forState:UIControlStateNormal]; When executing the app with Instruments I can see ...

SQL Server 2005 high memory usage and performance problems

Hi there guys. I have this ASP.NET/SQLServer2005 website running on a production server (Win2003, QuadCore, 4GB). The site runs smoothly normally, but after 2-3 weeks I notice a slow performance on the site (especifically in one particular page). Also I notice that the SQL Server process is using like 2GBs of RAM. So I restart the serv...

[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...

Blackberry application - get application memory usage stats

I'm trying to get the memory usage statistics (RAM, Flash and object handles) specific to our application, to be displayed on the device (not through the profiler). I've been using the Memory class to track general memory usage, but could not find a way to get the specific memory info. Is there a way to get this information from the Bla...

Does ReleaseStringUTF do more than free memory?

Consider the following C code segments. Segment 1: char * getSomeString(JNIEnv *env, jstring jstr) { char * retString; retString = (*env)->GetStringUTFChars(env, jstr, NULL); return retString; } void useSomeString(JNIEnv *env, jobject jobj, char *mName) { jclass cl = (*env)->GetObjectClass(env, jobj); jmethodId mId = (*...

JVMTI: FollowReferences : how to skip Soft/Weak/Phantom references?

I am writing a small code to detect number of objects left behind after certain actions in our tool. This uses FollowReferences() JVMTI-API. This counts instances reachable by all paths. How can I skip paths that included weak/soft/phantom reference? (IterateThroughHeap counts all objects at the moment, so the number is not fully r...

Force full garbage collection when memory occupation goes beyond a certain threshold

I have a server application that, in rare occasions, can allocate large chunks of memory. It's not a memory leak, as these chunks can be claimed back by the garbage collector by executing a full garbage collection. Normal garbage collection frees amounts of memory that are too small: it is not adequate in this context. The garbage coll...

How do I know if my PHP application is using too much memory?

I'm working on a PHP web application that let's users network with each other, book events, message etc... I launched it a few months ago and at the moment, there's only about 100 users. I set up the application on a VPS with ubuntu 9.10, apache 2, mysql 5 and php 5. I had 360 Mb of RAM, but upgraded to 720 MB a few minutes ago. Late...

Is there a (simple) way to get the memory usage of a lua table?

I'd like to find out how much memory a lua table is using - without iterating through the table contents and counting up the usage. Is there a lua 5.1 function or 3rd party library that could help with this. Thanks! ...

Handling large datasets with PHP/Drupal

Hi all, I have a report page that deals with ~700k records from a database table. I can display this on a webpage using paging to break up the results. However, my export to PDF/CSV functions rely on processing the entire data set at once and I'm hitting my 256MB memory limit at around 250k rows. I don't feel comfortable increasing the...

Split query result by half in TSQL (obtain 2 resultsets/tables)

I have a query that returns a large number of heavy rows. When I transform this rows in a list of CustomObject I have a big memory peak, and this transformation is made by a custom dotnet framework that I can't modify. I need to retrieve a less number of rows to do "the transform" in two passes and then avoid the memory peak. How can ...

Python: Does one of these examples waste more memory?

In a Django view function which uses manual transaction committing, I have: context = RequestContext(request, data) transaction.commit() return render_to_response('basic.html', data, context) # Returns a Django ``HttpResponse`` object which is similar to a dictionary. I think it is a better idea to do this: context = RequestContext(...

How to get accuracy memory usage on iphone device.

I want to output accuracy memory usage on iphone device, the method I used was taking from, http://landonf.bikemonkey.org/code/iphone/Determining%5FAvailable%5FMemory.20081203.html natural_t mem_used = (vm_stat.active_count + vm_stat.inactive_count + vm_stat.wire_count) * pagesize; na...

Java BigDecimal memory usage?

Is there a guideline for estimating the amount of memory consumed by a BigDecimal? Looking for something similar to these guidelines for estimating String memory usage. ...

php multidimensional arrays, memory management

i need a structure like this array(){ [0] => array(){ [0] => array(){ // this array will have 'n' values(n is large, like 2000) } [1] => array(){ // this array will have 'n' values(n is large, like 2000) } ...

How to show percentage of 'memory used' in a win32 process?

I know that memory usage is a very complex issue on Windows. I am trying to write a UI control for a large application that shows a 'percentage of memory used' number, in order to give the user an indication that it may be time to clear up some memory, or more likely restart the application. One implementation used ullAvailVirtual fr...

Timing program execution

I have a project written in C and I would like to know if there is a simple way to profile its execution time and memory usage under Windows. Thanks in advance. ...