memory

Problem facing in reading file from Internal memory of android

Hi Guys, I am facing the problem with openfileinput class. First thing is , I am saving my username and password in the file.On sucessful login, I will be saving and moving to internal home screen.The problem is when I logout or close the application, and reopen the application I am able to read the data but when I convert it to String ...

PHP Array Efficiency and Memory Clarification

When declaring an Array in PHP, the index's may be created out of order...I.e Array[1] = 1 Array[19] = 2 Array[4] = 3 My question. In creating an array like this, is the length 19 with nulls in between? If I attempted to get Array[3] would it come as undefined or throw an error? Also, how does this affect memory. Would the memory of 3 ...

What is the cost of memory access?

We like to think that a memory access is fast and constant, but on modern architectures/OSes, that's not necessarily true. Consider the following C code: int i = 34; int *p = &i; // do something that may or may not involve i and p {...} // 3 days later: *p = 643; What is the estimated cost of this last assignment in CPU instructi...

Android -- Object Creation/Memory Allocation vs. Performance

Hello all, This is probably an easy one. I have about 20 TextViews/ImageViews in my current project that I access like this: ((TextView)multiLayout.findViewById(R.id.GameBoard_Multi_Answer1_Text)).setText(""); //or ((ImageView)multiLayout.findViewById(R.id.GameBoard_Multi_Answer1_Right)).setVisibility(View.INVISIBLE); My question i...

Memory management technique for Objective-C iVars/properties

Is the following code doing anything unnecessary? @interface MyClass { NSArray *myArray; } -(void)replaceArray:(NSArray *)newArray; @implementation MyClass -(void)replaceArray:(NSArray *)newArray { if( myArray ) { [myArray release]; myArray = nil; } myArray = [[NSArray alloc] initWithArray: newArray]; }...

Which of these Array Initializations is better in Ruby?

Hi, Which of these two forms of Array Initialization is better in Ruby? Method 1: DAYS_IN_A_WEEK = (0..6).to_a HOURS_IN_A_DAY = (0..23).to_a @data = Array.new(DAYS_IN_A_WEEK.size).map!{ Array.new(HOURS_IN_A_DAY.size) } DAYS_IN_A_WEEK.each do |day| HOURS_IN_A_DAY.each do |hour| @data[day][hour] = 'something' end end Method ...

AS2 Net connection memory leak

Hi, I noticed that NetConnection leaks memory var nc:NetConnection = new NetConnection(); var o = new Object(); o.onResult = function () { trace ("onResult"); nc.close(); loadData(); } nc.onStatus = function () { trace ("onStatus"); nc.close(); loadData(); } function loadData () { // some amf serv...

Completely Removing Views from memory

I have a view which is slideshow settings, and another view which has a slideshow. Unfortunately, these views conflict because they are still in memory. As far as I know, viewDidUnload and dealloc are only called in low-memory situations, and dealloc should not be called directly, so how do I completely remove a view. These views are wi...

Memory Issues When DOM Parsing A Large XML File on Android Devices

Hey awesome SO users, I have an Android application that parses an XML file for users and displays results in a much more mobile friendly format. The app works great for most users, but some users have lots and lots of data and the app crashes on them because it runs out of memory. Is there any way I have a DOM style XML parser quit pa...

iPhone app memory leaks from core frameworks

Are these kind of leaks normal? Are they false leaks or something I should be concerned with? The instruments tool doesn't give me any line of code from my app, seems Apple's frameworks are leaking?! Ok, the problems could only come from here: (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexP...

C# / XNA - Load objects to the memory - how it works?

Hello I'm starting with C# and XNA. In the "Update" method of the "Game" class I have this code: t = Texture2D.FromFile( [...] ); //t is a 'Texture2D t;' which loads small image. "Update" method is working like a loop, so this code is called many times in a second. Now, when I run my game, it takes 95MB of RAM and it goes slowly to ...

[PHP] - Memory usage/profiling

I'm using Netbeans + Xdebug + Winchachegrind and finally got it to work, but there is no memory usage information. Is it an Xdebug or WinCachegrind limit? ...

Memory leak using NSMutableArray in RootViewController called from App Delegate

I've written code to restore the state of my app, but there's a memory leak in the NSMutableArray. I'm new to Xcode so I apologize if this is something trivial I have overlooked. Any help is appreciated. lq AppDelegate.m - (void)applicationDidFinishLaunching:(UIApplication *)application { [rootViewController restoreState]; } RootV...

Visual Studio 2010 -- how to reduce its memory footprint

I have a solution with just under 100 projects in it, a mix of C++ and C# (mostly C#). When working in VS2005, the working set of Visual Studio is considerably smaller than that of VS2010. I was wondering if there are some things that can be turned off, so I can develop in VS2010 under 32-bit OS without running out of memory. ...

Large Memory Leak Using Reachability

Using Instruments on the device it detects a 3.50 KB memory leak using Apple's Reachability 2.0 code in my app. The Leaked Object is GeneralBlock-3584. The leaks tool points to the following code: - (BOOL) startNotifer { BOOL retVal = NO; SCNetworkReachabilityContext context = {0, self, NULL, NULL, NULL}; if(SCNetworkReac...

Ways to determine size of complex object in .NET?

Are there ways at determining the total size of a complex object in .NET? This object is composed of other objects and might hold references to other complex objects. Some of the objects encapsulated by this object might be POD, others may not. ...

jQuery server ping slowly but surely filling memory?

I use the following piece of code to test if our server is running whilst the user is in a page. I've also started adding other functions that grab small amounts of data that are constantly changing and are to be relayed to the user (Files waiting for download, messages, reports etc). I've noticed recently that if I leave any page open...

how can c# help in drawing using memory layers concept?

hello all i am facing problem in drawing dynamically in a picture box. i works very good when the drawing objects are few but as the drawing objects increases the response time of my GUI is getting worse and worse, my GUI works very well up to 90 drawing objects but i have to support more than 1000 so this technique didn't work for me. ...

why is stack and heap both required for memory allocation

I've searched a while but no conclusive answer is present on why value types have to be allotted on the stack while the reference types i.e. dynamic memory or the objects have to reside on the heap. why cannot the same be alloted on the stack? ...

How can i get the iphone's CPU usage and memory usage?

How can i get the ipad's CPU usage and memory usage? ...