memory

Simulate memory warnings from the code, possible?

I know i can simulate a memory warning on the simulator by selecting 'Simulate Memory Warning' from the drop down menu of the iPhone Simulator. I can even make a hot key for that. But this is not what I'd like to achieve. I'd like to do that from the code by simply, lets say doing it every 5 seconds. Is that possible? ...

renderInContext creating memory that is not promptly released

While debugging in instruments using 'ObjectAlloc' I'm noticing 7megs of memory being allocated for the renderInContext call, but it never is released. When I comment out the renderInContext call this doesn't happen, and future renderInContext calls does not continue to increase the memory allotment. UIGraphicsBeginImageContext(contentH...

Objective-C Out of scope problem

Hi, I'm having a few problems with some Objective-C and would appreciate some pointers. So I have a class MapFileGroup which has the following simple interface (There are other member variables but they aren't important): @interface MapFileGroup : NSObject { NSMutableArray *mapArray; } @property (nonatomic, retain) NSMutableArray ...

PDF document in webBrowser control cause 'The memory could not be "read"' error when closing application

I am using a webBrowser control to open PDF document in winforms, it works fine but when closing the application I get sometimes an error : "The Instruction at "0x2d864aa2" referenced memory at "0x00000008". The memory could not be "read". Is there a solution for this problem? Regards. ...

Why does Java uses heap for memory allocation?

I just read this statement in a java book saying Objects in java reside on a heap. Is a heap used because it is the best way to store data and retrieve data fast ? I only have an idea about data structures being a beginner. I mean why not stack or something else ? ...

LinkedList memory consumption versus List when working with large arrays

Hi, Can anyone tell me if a linkedlist of structures will be allowed to grow larger than the equivalent List (given that a list uses a doubling strategy for increasing the size of it's internal array). So given a struct that is say 40 bytes (I know about the 16 bytes and structure thing, but I am working with some legacy code here and ...

.Net OutOfMemory on Server but not Desktop

Is it possible that the .Net framework behaves differently when it comes to garbage collection / memory limitations on server environments? I am running explicitly x86 compiled apps on a 64bit server machine with 32gbs of physical ram and I am running out of memory (SystemOutOfMemoryException) even though nothing but that particular app ...

WPF Datatemplate + ItemsControl each item uses > 1 MB Memory?

Does that sound right to anyone???? I have an ItemsControl that displays data from a custom object that implements iNotifyPropertyChanged. The DataTemplate consists of: Border 3 buttons 5 textboxes An ellipse A Bindable RichTextBox (custom class that inherits from RichTextBox... so I could make Document a dependency property (to suppo...

which is better in general, map or vector in c++?

As I know that accessing an element in vector takes constant time while in map takes logarithmic time. However, storing a map takes less memory than storing a vector. Therefore, I want to ask which one is better in general? I'm considering using one of those two in my program, which has about 1000 elements. I plan to use 3 dimensional v...

Is it better to store an NSArray of NSManagedObjects or NSManagedObjectIDs?

In my application I need to keep track of a list of objects that are being displayed. Right now I have an NSArray with all of the NSManagedObjects. Would I be better off to store the ObjectIDs and then only request the object when I need it? I am mainly concerned about memory at this point. ...

Why can't I reserve 1,000,000,000 in my vector ?

When I type in the foll. code, I get the output as 1073741823. #include <iostream> #include <vector> using namespace std; int main() { vector <int> v; cout<<v.max_size(); return 0; } However when I try to resize the vector to 1,000,000,000, by v.resize(1000000000); the program stops executing. How can I enable the program to all...

Available memory for iPhone OS app

Is there a function or constant defining the amount of available memory for an app in iPhone OS? I'm looking for a device-independent way (iPod touch, iPhone, iPad) to know how much memory the app has left. ...

iPhone App takes up too much memory

Ok, so here's my problem. My iPhone app is 1.2MB on disk. Granted I have a bunch of Images for the GUI buttons and backgrounds, etc. In-memory, my app takes up a whopping 15MB! That means if I then take a picture with the camera, 8MB default, it gives a memory warning (several) even before the picker calls its delegate! How can I te...

is there a way to estimate the ram needed by a .net mvc application?

Is there a soft to do that? I'm looking for a windows server (I might go for a VPS server), and I would like to know the ram I will need I know I won't need a lot of ram, but beside the "windows task manager", is there a way to really test that? Thanks ...

Delphi Unicode String Type Stored Directly at its Address (or "Unicode ShortString")

I want a string type that is Unicode and that stores the string directly at the adress of the variable, as is the case of the (Ansi-only) ShortString type. I mean, if I declare a S: ShortString and let S := 'My String', then, at @S, I will find the length of the string (as one byte, so the string cannot contain more than 255 characters...

how do i scroll through 100 photos in UIScrollView in IPhone

I'm trying to scroll through images being downloaded from a users online album (like in the facebook iphone app) since i can't load all images into memory, i'm loading 3 at a time (prev,current & next). then removing image(prev-1) & image (next +1) from the uiscroller subviews. my logic works fine in the simulator but fails in the device...

Huge Graph Structure

I'm developing an application in which I need a structure to represent a huge graph (between 1000000 and 6000000 nodes and 100 or 600 edges) in memory. The edges representation will contain some attributes of the relation. I have tried a memory map representation, arrays, dictionaries and strings to represent that structure in memory, ...

How to find the byte offset of an object in C++?

Let's say I create 5 objects, all from the same class. Would the byte offset of the first object be 0? How would I find out the byte offset of the other objects? ...

Adding and removing inputs via jQuery's remove(), but page gets slow, how to free memory?

I'm dynamically adding a lot of input fields through jQuery but the page gets really slow when reaching 200+ inputs (think of the page like a html excel sheet). This is fine really because this scenario is not very common. However, when I dynamically remove the input fields from the page using jQuery's htmlObj.remove() function, the page...

jvm issue at startup

I can set the max memory as 1000 and not more than that, if I set the memory more than that, it throws the following error. Error occurred during initialization of VM Could not reserve enough space for object heap Could not create the Java virtual machine. My question is, why jvm looks for the max memory at startup? Thanks in advance....