memory

how to get the memory access type in C/C++ in Linux

I have a pointer and I want to check if the referenced memory is readable, writeable and/or executable. How can I do this? ...

Initializing an object in Perl

Hi everyone, So, i'm a bit of a perl newb. Although I had something much more complicated going, i all of a sudden hit a roadblock and cannot figure out wtf is wrong with the code. I've simplified it so greatly that it's only a very small fragment of code. Test.pl package Test; sub new { my ($class) = shift; my $self = { _att...

Problem: .NET Performance counter data goes missing after a short period

I am trying to log the .Net memory performance counters but the logs stop recording data after a bit. I am doing this for a bunch of servers and all of them stop working at different points in time. Here is the one I am logging .NET CLR Memory(w3wp)# Total reserved Bytes But the other counters like vbytes etc. also show the same results....

How to fix a "java.lang.OutOfMemoryError: bitmap size exceeds VM budget " error on android

Hi all, I've seen this question asked many times but none of the answers really made sense in what I'm doing... I have an android game (see source at google source control) It's a card game, and I've used a method that redraws each hand every round - that might be wasteful but I couldnt think of a better way to do it. Here is the code fo...

Whats a good java debugger?

I'm trying to find memory leaks and performance issues with my java application. Is there a program out there that can help me debug my application and display performance results? Thanks. ...

NSArray objects go out of scope after returning pointer

I am attempting to use the below code in a function to return an array of dictionary objects. Unfortunately, after the return to the next function in the stack all of the rows in the mutable array have become 'out of scope'. From my understanding, the array should retain the row (dictionary) object automatically so even after the retur...

shared memory locking and process crash

Hi guys, I want try to understand better the problem of synchronization of shared memory. I have understood that interprocess synchronization can work differently on different operating system. The most difference is what's happening when a process that has locked the shared memory crash. Windows free locked named mutex after a process c...

How to decrease the memory consumption of a WordPress site?

The test site requires a lot of memory when viewing some category/archive pages. I met with the following error messages yesterday: Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 48 bytes) in /var/www/t/wp-includes/load.php on line 552 Fatal error: Allowed memory size of 209715200 bytes ex...

How i can clean iphone proccesor

I have app that need high latency If i do 2 measure after press button - given me +-0.5 between 2 result If i do next 2 measure after press button - given me +-20 Also i have same situation if i exit app and start than press button exit app and start than press button ...

How to prevent unnecessary memory use in recursive functions

I've just written a recursive function and it dawned on me that all the variables I use within the function will remain allocated in memory until recursion breaks. If I am recursing a large number of times or allocating large amounts of memory for variables not used in the consequent recursive function call, could this lead to alot of w...

when I create an object of a class, does it execute ALL methods inside the class or just methods called?

I am curious, if I create a class of many methods (functions as PHP still call them) which many of them are not used and I create an object, does it create memory for all methods even if most methods aren't being used? I'm doing PHP OOP coding. ...

C: memory address literal

Given a literal memory address in hexadecimal format, how can I create a pointer in C that addresses this memory location? Memory addresses on my platform (IBM iSeries) are 128bits. C type long long is also 128bits. Imagine I have a memory address to a string (char array) that is: C622D0129B0129F0 I assume the correct C syntax to dir...

Create a DWORD Pointer from Offset

So if I want to read some information at the offset 00A2E63C (e.g.)... and I need to have it as a DWORD, how can I convert the "00A2E63C" String to a proper DWORD? help is appreciated ...

Releasing custom made NSObject class in iPhone App

Hi, I have a Class which I have created as an NSObject. This class has a number of properties of different types and methods etc. When I instantiate this class in my App (say in the main View Controller) I immediately send it a release call when I am finished using it. ie: MyObject *myObject = [[MyObject alloc] initWithParameters:pa...

Reasons why my Android App would crash on my phone consistently, but not on my emulator

I have an app that uses quite a few graphics in it. When I open and close my app repeatedly on my emulator (1.5 - 2.2) it runs fine and by checking the heap I can see everything is being cleaned and gc'd properly. However, when I run my app on an HTC Aria phone (2.1) the app crashes every time I try to re-open it. When I look at the h...

Memory utiliziation when calling an object's method via the Interface?

Is there any relation to memory optimization when we call a method by using an interface. Is only that method loaded in memory? When a invoke a method via an object are all the methods of that object loaded into memory? ...

The current way to release memory from a UIScrollview with many images

Dear Scholars. I am generating a simple scrollView with some images attached to buttons. This works fine apart from the fact that this scroll view is taking rather much memory. Since this scrollView is just a sub Menu allowing the user to pick an image and soon after I do not need it, I would like to free this heavy block from memory. ...

Freeing static memory? no, that can't be right

I've been playing around with embedding resources into my c++ program. In order to do this I hexdump the data to a simple array, i.e. unsigned char image_png[] ={ 0x0a, 0x0b, 0x0c, 0x0d, ... }; Some of these resources are not used after loading (i.e. they get converted to something else and then the original data is just bulk... t...

How to write a C or C++ program to act as a memory and CPU cycle filler?

I want to test a program's memory management capabilities, for example (say, program name is director) What happens if some other processes take up too much memory, and there is too less memory for director to run? How does director behave? What happens if too many of the CPU cycles are used by some other program while director is runn...

overhead in addressing 2d array in linear memory space

Does addressing addressing values in a multidimensional array in a linear fashion as in values[row_num*row_width + column_num] incur extra computation for the multiplication/addition when compared to values[row][col]? Or does the compiler convert the latter to the former anyway? ...