Search Results

Search found 12267 results on 491 pages for 'out of memory'.

Page 218/491 | < Previous Page | 214 215 216 217 218 219 220 221 222 223 224 225  | Next Page >

  • iPhone using Camera causes array to be unloaded

    - by Aaron Dale
    I have an array of images that I'm displaying in a UITableView. When choosing images from the library using the UIImagePicker, everything is totally fine and I can add a lot of images to the array. As soon as I add an image from the camera using the Picker I receive a memory warning and my array of images is ditched. Coming back from the camera picker, the table view is empty. The UIImagePicker when using the camera as the source generates a memory warning before I have a chance to resize the image.

    Read the article

  • Why in Objective-C, we use self = [super init] instead of just [super init]?

    - by ????
    In a book, I saw that if a subclass is overriding a superclass's method, we may have self = [super init]; First, is this supposed to be done in the subclass's init method? Second, I wonder why the call is not just [super init]; ? I mean, at the time of calling init, the memory is allocated by alloc already (I think by [Foobar alloc] where Foobar is the subclass's name. So can't we just call [super init] to initialize the member variables? Why do we have to get the return value of init and assign to self? I mean, before calling [super init], self should be pointing to a valid memory allocation chuck... so why assigning something to self again? (if assigning, won't [super init] just return self's existing value?)

    Read the article

  • XML Processing on iPhone: What is the best option?

    - by gonso
    Hello Im building a new version of an iPhone application and Im wondering if I should review how my app communicates with the server. My iPhone client sends and receives XML over HTTP requests. To send the information I use ASIHTTPRequest framework. I "manually" build the XML request by appending strings. To parse the response Im using a NSXMLParser. My question is if I have better options to A) Create an XML string from a memory object. B) Create a memory object from the XML string. Is there anything like JAXB to marshal XML into object? Thanks Gonso

    Read the article

  • Integer v/s int

    - by Siddhartha
    Read this on the oracle docs java.lang page: Frequently it is necessary to represent a value of primitive type as if it were an object. The wrapper classes Boolean, Character, Integer, Long, Float, and Double serve this purpose. I'm not sure I understand why these are needed. It says they have useful functions such as equals(). But if I can do (a==b), why would I ever want to declare them as Integer, use more memory and use equals()? How does the memory usage differ for the 2?

    Read the article

  • OOP question about functions that struck me all of a sudden.

    - by Nitesh Panchal
    Hello, May be my question is stupid. But i would like to get it cleared. We know that functions are loaded in memory only once and when you create new objects, only instance variables gets created, functions are never created. My question is, say suppose there is server and all clients access a method named createCustomer(). Say suppose all clients do something which fired createCustomer on server. So, if the method is in middle of execution and new client fires it. Will the new request be put on wait? or new request also will start executing the method? How does it all get managed when there is only one copy of function in memory? No book mentions answers to this type of questions. So i am posting here where i am bound to get answers :).

    Read the article

  • SELECT only a certain set of rows at a time

    - by prmatta
    I need to select data from one table and insert it into another table. Currently the SQL looks something like this: INSERT INTO A (x, y, z) SELECT x, y, z FROM B b WHERE ... However, the SELECT is huge, resulting in over 2 millions rows and we think it is taking up too much memory. Informix, the db in this case, runs out of virtual memory when the query is run. How would I go about selecting and inserting a set of rows (say 2000)? Given that I don't think there are any row ids etc.

    Read the article

  • How to use unset() for this Linear Linked List in PHP

    - by Peter
    I'm writing a simple linear linked list implementation in PHP. This is basically just for practice... part of a Project Euler problem. I'm not sure if I should be using unset() to help in garbage collection in order to avoid memory leaks. Should I include an unset() for head and temp in the destructor of LLL? I understand that I'll use unset() to delete nodes when I want, but is unset() necessary for general clean up at any point? Is the memory map freed once the script terminates even if you don't use unset()? I saw this SO question, but I'm still a little unclear. Is the answer that you simply don't have to use unset() to avoid any sort of memory leaks associated with creating references? I'm using PHP 5.. btw. Unsetting references in PHP PHP references tutorial Here is the code - I'm creating references when I create $temp and $this-head at certain points in the LLL class: class Node { public $data; public $next; } class LLL { // The first node private $head; public function __construct() { $this->head = NULL; } public function insertFirst($data) { if (!$this->head) { // Create the head $this->head = new Node; $temp =& $this->head; $temp->data = $data; $temp->next = NULL; } else { // Add a node, and make it the new head. $temp = new Node; $temp->next = $this->head; $temp->data = $data; $this->head =& $temp; } } public function showAll() { echo "The linear linked list:<br/>&nbsp;&nbsp;"; if ($this->head) { $temp =& $this->head; do { echo $temp->data . " "; } while ($temp =& $temp->next); } else { echo "is empty."; } echo "<br/>"; } } Thanks!

    Read the article

  • Displaying same icon in 2 different sizes on c#

    - by ET
    My goal is to display the same icon twice, but each time in different size. I tried the following: FileStream fs = new FileStream("name_of_the_icon_file.ico", FileMode.Open); Icon ico = new Icon(fs, 32, 32); //create an in-memory instance of the icon, size 32x32 Icon ico2 = new Icon(fs, 16, 16); //create an in-memory instance of the icon, size 16x16 ... Graphics.DrawIcon(ico, /*some point*/); Graphics.DrawIcon(ico2, /*some other point*/); The last line throws an ArgumentException: Value does not fall within the expected range. Can some one explain me whats wrong and whats the way to do this right?

    Read the article

  • Create a modifiable string literal in C++

    - by Anne
    Is it possible to create a modifiable string literal in C++? For example: char* foo[] = { "foo", "foo" }; char* afoo = foo[0]; afoo[2] = 'g'; // access violation This produces an access violation because the "foo"s are allocated in read only memory (.rdata section I believe). Is there any way to force the "foo"s into writable memory (.data section)? Even via a pragma would be acceptable! (Visual Studio compiler) I know I can do strdup and a number of other things to get around the problem, but I want to know specifically if I can do as I have asked. :)

    Read the article

  • Data format for content heavy iPhone app - Plist or XML?

    - by Toby
    Hello, I'm building an iPhone app that is essentially a book, it will be bundled with a lot of text-heavy content. I considered bundling the data as XML and load it when the application starts but the XML would contain a lot of nested structures and be a bit of a pain to parse. Would it be better to use a plist? I'm concerned about memory usage and plists are loaded entirely into memory - can they be parsed in chunks? Is there a maximum size to a plist and how efficient are they? I'm not sure how big the bundled content is going to be yet but I should imagine it could be anywhere from 500k to 4MB. Thanks in advance.

    Read the article

  • Simple, Custom Parsing with c++

    - by bradkovach
    Hi! I have been reading SO for some time now, but I truly cannot find any help for my problem. I have a c++ assignment to create an IAS simulator. Here is some sample code... 0 1 a 1 2 b 2 c 3 1 10 begin 11 . load a, subtract b and offset by -1 for jump+ 11 load M(0) 12 sub M(1) 13 sub M(3) 14 halt Using c++, I need to be able to read these lines and store them in a "memory register" class that I already have constructed... For example, the first line would need to store "1 a" in register zero. How can I parse out the number at the line beginning and then store the rest as a string? I have setup storage using a class that is called using mem.set(int, string);. int is the memory location at the beginning of the line and string is the stored instruction.

    Read the article

  • Not seeing Sync Block in Object Layout

    - by bob-bedell
    It's my understanding the all .NET object instances begin with an 8 byte 'object header': a synch block (4 byte pointer into a SynchTableEntry table), and a type handle (4 byte pointer into the types method table). I'm not seeing this in VS 2010 RC's (CLR 4.0) debugger memory windows. Here's a simple class that will generate a 16 byte instance, less the object header. class Program { short myInt = 2; // 4 bytes long myLong = 3; // 8 bytes string myString = "aString"; // 4 byte object reference // 16 byte instance static void Main(string[] args) { new Program(); return; } } An SOS object dump tells me that the total object size is 24 bytes. That makes sense. My 16 byte instance plus an 8 byte object header. !DumpObj 0205b660 Name: Offset_Test.Program MethodTable: 000d383c EEClass: 000d13f8 Size: 24(0x18) bytes File: C:\Users\Bob\Desktop\Offset_Test\Offset_Test\bin\Debug\Offset_Test.exe Fields: MT Field Offset Type VT Attr Value Name 632020fc 4000001 10 System.Int16 1 instance 2 myInt 632050d8 4000002 4 System.Int64 1 instance 3 myLong 631fd2b8 4000003 c System.String 0 instance 0205b678 myString Here's the raw memory: 0x0205B660 000d383c 00000003 00000000 0205b678 00000002 ... And here are some annotations: offset 0 000d383c ;TypeHandle (pointer to MethodTable), 4 bytes offset 4 00000003 00000000 ;myLong, 8 bytes offset 12 0205b678 ;myString, 4 byte reference to address of "myString" on GC Heap offset 16 00000002 ;myInt, 4 bytes My object begins a address 0x0205B660. But I can only account for 20 bytes of it, the type handle and the instance fields. There is no sign of a synch block pointer. The object size is reported as 24 bytes, but the debugger is showing that it only occupies 20 bytes of memory. I'm reading Drill Into .NET Framework Internals to See How the CLR Creates Runtime Objects, and expected the first 4 bytes of my object to be a zeroed synch block pointer, as shown in Figure 8 of that article. Granted, this is an article about CLR 1.1. I'm just wondering if the difference between what I'm seeing and what this early article reports is a change in either the debugger's display of object layout, or in the way the CLR lays out objects in versions later than 1.1. Anyway, can anyone account for my 4 missing bytes?

    Read the article

  • What's the difference between initializing this structure with these strategies?

    - by mystify
    // the malloc style, which returns a pointer: struct Cat *newCat = malloc(sizeof(struct Cat)); // no malloc...but isn't it actually the same thing? uses memory as well, or not? struct Cat cat = {520.0f, 680.0f, NULL}; Basically, I can get a initialized structure in these two ways. My guess is: It's the same thing, but when I use malloc I also have to free() that. In the second case I don't have to think about memory, because I don't call malloc. Maybe. When should I use the malloc style, and when the other?

    Read the article

  • iOS Downloading Videos and saving in Application Support folder

    - by Satyam svv
    In my application, i've to download videos around 10 to my application and play accordingly. Each video is around 50 MB. I'm using following code and then after downloading the video, i'm saving it to Application support folder to avoid icloud sync. But the problem is that when downloading the videos its crashing. [NSURLConnection sendAsynchronousRequest:req queue:[[NSOperationQueue alloc] init] completionHandler:^(NSURLResponse *response, NSData *rcvdDat, NSError * err) { . . . } What I'm thinking is that, while downloading the video, it resides in memory and so the total memory occupying by the app is increasing. Finally iOS is making the app to close. I would like to download the video and when ever a stream of data received, write to temp file and when completes move it to application support folder. Can some one help me on how to write it to file and save it at the end? I cannot use 3rd party libraries (unless its small) due to legal issues.

    Read the article

  • How to Dispose myClass with Garbage Collecter C#

    - by Ibrahim AKGUN
    Hi, I have a class and got a method that doin so many things in memory and need to be disposed when its jobs done.But i have looked for MSDN for solution.There is an example thats not solved my problem.When my Class is instanced and run this method my memory is getting bigger and bigger.How can i Dispose it when its job done ? Here is my CODES ; class Deneme { public Deneme() { } ~Deneme() { GC.Collect(); GC.SuppressFinalize(this); } public void TestMetodu() { System.Windows.Forms.MessageBox.Show("Test"); // This is my method that doing big jobs :) } } Deneme CCCX = new Deneme(); CCCX.TestMetodu(); CCCX = null; So i cant dispose it with this.

    Read the article

  • how do I download a large file (via HTTP) in .NET

    - by nickcartwright
    I need to download a LARGE file (2GB) over HTTP in a C# console app. Problem is, after about 1.2GB, the app runs out of memory. Here's the code I'm using: WebClient request = new WebClient(); request.Credentials = new NetworkCredential(username, password); byte[] fileData = request.DownloadData(baseURL + fName); As you can see... I'm reading the file directly into memory. I'm pretty sure I could solve this if I were to read the data back from HTTP in chunks and write it to a file on disk. Does anyone know how I could do this?

    Read the article

  • Java: empty ArrayLists in a foor loop

    - by Patrick
    hi, I'm reusing the same ArrayList in a for loop, and I use for loop results = new ArrayList<Integer>(); experts = new ArrayList<Integer>(); output = new ArrayList<String>(); .... to create new ones. I guess this is wrong, because I'm allocating new memory. Is this correct ? If yes, how can I empty them ? Added: another example I'm creating new variables each time I call this method. Is this good practice ? I mean to create new precision, relevantFound.. etc ? Or should I declare them in my class, outside the method to not allocate more and more memory ? public static void computeMAP(ArrayList results, ArrayList experts) { //compute MAP double precision = 0; int relevantFound = 0; double sumprecision = 0; thanks

    Read the article

  • WPF Prism deactivate ?

    - by 2Fast4YouBR
    Hi all, I have an problem and would like to know if it is common problem or jsut with me. I am using Wpf with Prism and Unity, all with the pattern MvvM. I am loading a viewModel that has a reference to a dropdown with few items, my idea is that each time that the user click in some place to open the view that has this dropdown is that the dropdown will be shown with diferent values. The problem is that I see is that after I show the view for the first time and after the first DEACTIVATE, when I try to load it again looks like it is already in the memory (was not deactivated/disposed), so as is already in memory, it not call the constructor again of the modelView and the dropdown is shown with tha same old values. public BranchSelectionViewModel(IUnityContainer unityContainer) { this.unityContainer = unityContainer; User user = this.unityContainer.Resolve<User>(); this.branches = new ObservableCollection<Department>(user.Departments .Where(department => department.DepartmentId != user.SelectedDepartment.DepartmentId)); }

    Read the article

  • Is it a problem if i query again and again to SQL Server 2005 and 2000?

    - by learner
    Window app i am constructing is for very low end machines (Celeron with max 128 RAM). From the following two approaches which one is the best (I don't want that application becomes memory hog for low end machines):- Approach One:- Query the database Select GUID from Table1 where DateTime <= @givendate which is returning me more than 300 thousands records (but only one field i.e. GUID - 300 thousands GUIDs). Now running a loop to achieve next process of this software based on GUID. Second Approach:- Query the database Select Top 1 GUID from Table1 where DateTime <= @givendate with top 1 again and again until all 300 thousands records done. It will return me only one GUID at a time, and I can do my next step of operation. What do you suggest which approach will use the less Memory Resources?? (Speed / performance is not the issue here).

    Read the article

  • When should one let an application crash because of an exception in Java (design issue)?

    - by JVerstry
    In most cases, it is possible to catch exceptions in Java, even unchecked ones. But, it is not necessarily possible to do something about it (for example out of memory). For other cases, the issue I am trying to solve is a design principle one. I am trying to set-up a design principle or a set of rules indicating when one should give up on an exceptional situation, even if it is detected in time. The objective is trying to not crash the application as much as possible. Has someone already brainstormed and communicated about this? I am looking for specific generic cases and possible solutions, or thumb-rules. UPDATE Suggestions so far: Stop running if data coherency can be compromised Stop running if data can be deleted Stop running if you can't do anything about it (Out of memory...) Stop running if key service is not available or becomes unavailable and cannot be restarted If application must be stopped, degrade as gracefully as possible Use rollbacks in db transactions Log as much relevant information as you can Notify the developers

    Read the article

  • Shared data in an ASP.NET application

    - by Barguast
    I have a basic ASP.NET application which is used to request data which is stored on disk. This is loaded from files and sent as the response. I want to be able to store the data loaded from these files in memory to reduce the number of reads from disk. All of the requests will be asking for the same data, so it makes sense to have a single cache of in-memory data which is accessible to all requests. What is the best way to create a single accessible object instance which I can use to store and access this cached data? I've looked into HttpApplication, but apparently a new instance of this is created for parallel requests and so it doesn't fit my needs.

    Read the article

  • Tie destruction of an object (sealed) to destruction of an unmanaged buffer

    - by testtestSO
    I'll explain my situation first: I'm interested of using the Bitmap constructor that takes scan0, stride and format, because I'm decoding tiled images and I'd like to choose my own stride so I can decode the tiles without caring about the bounds in the decoder part. Anyway, the problem is that the documentation says: The caller is responsible for allocating and freeing the block of memory specified by the scan0 parameter. However, the memory should not be released until the related Bitmap is released. I can't release the buffer easily, because the Bitmap is then passed to another class that will eventually destroy it and I don't have control over it. Is there some way (hacky, I know) to tell the GC to also release my buffer when the Bitmap is destroyed? (Also, any alternative solution is welcome).

    Read the article

< Previous Page | 214 215 216 217 218 219 220 221 222 223 224 225  | Next Page >