Search Results

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

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

  • C++: Why don't I need to check if references are invalid/null?

    - by jbu
    Hi all, Reading http://www.cprogramming.com/tutorial/references.html, it says: In general, references should always be valid because you must always initialize a reference. This means that barring some bizarre circumstances (see below), you can be certain that using a reference is just like using a plain old non-reference variable. You don't need to check to make sure that a reference isn't pointing to NULL, and you won't get bitten by an uninitialized reference that you forgot to allocate memory for. My question is how do I know that the object's memory hasn't been freed/deleted AFTER you've initialized the reference. What it comes down to is that I can't take this advice on faith and I need a better explanation. Can anyone shed some light? Thanks, jbu

    Read the article

  • Advice on "Invalid Pointer Operation" when using complex records

    - by Xaz
    Env: Delphi 2007 <JustificationI tend to use complex records quite frequently as they offer almost all of the advantages of classes but with much simpler handling.</Justification Anyhoo, one particularly complex record I have just implemented is trashing memory (later leading to an "Invalid Pointer Operation" error). This is an example of the memory trashing code: sSignature := gProfiles.Profile[_stPrimary].Signature.Formatted(True); On the second time i call it i get "Invalid Pointer Operation" It works OK if i call it like this: AProfile := gProfiles.Profile[_stPrimary]; ASignature := AProfile.Signature; sSignature := ASignature.Formatted(True); Background Code: gProfiles: TProfiles; TProfiles = Record private FPrimaryProfileID: Integer; FCachedProfile: TProfile; ... public < much code removed > property Profile[ProfileType: TProfileType]: TProfile Read GetProfile; end; function TProfiles.GetProfile(ProfileType: TProfileType): TProfile; begin case ProfileType of _stPrimary : Result := ProfileByID(FPrimaryProfileID); ... end; end; function TProfiles.ProfileByID(iID: Integer): TProfile; begin <snip> if LoadProfileOfID(iID, FCachedProfile) then begin Result := FCachedProfile; end else ... end; TProfile = Record private ... public ... Signature: TSignature; ... end; TSignature = Record private public PlainTextFormat : string; HTMLFormat : string; // The text to insert into a message when using this profile function Formatted(bHTML: boolean): string; end; function TSignature.Formatted(bHTML: boolean): string; begin if bHTML then result := HTMLFormat else result := PlainTextFormat; < SNIP MUCH CODE > end; OK, so I have a record within a record within a record, which is approaching Inception level confusion and I'm the first to admit is not really a good model. Clearly i am going to have to restructure it. What I would like from you gurus is a better understanding of why it is trashing the memory (something to do with the string object that is created then freed...) so that i can avoid making these kinds of errors in future. Thanks

    Read the article

  • How to deal with large result sets with Linq to Entities?

    - by user169867
    I have a fairly complex linq to entities query that I display on a website. It uses paging so I never pull down more than 50 records at a time for display. But I also want to give the user the option to export the full results to Excel or some other file format. My concern is that there could potentially be a large # of records all being loaded into memory at one time to do this. Is there a way to process a linq result set 1 record at a time like you could w/ a datareader so only 1 record is really being kept in memory at a time? I'd appreciate any help. Thanks

    Read the article

  • Multimap Space Issue: Guava

    - by Arpssss
    In my Java code, I am using Guavas Multimap (com.google.common.collect.Multimap) by using this: Multimap< Integer, Integer Index = HashMultimap.create() Here, Multimap key is some portion of URL and value is another portion of URL (converted into integer). Now, I assign my JVM 2560 Mb (2.5 GB) heap space (by using Xmx and Xms). However, it can only store 9 millions of such (key,value) pairs of integers (approx 10 million). But, theoretically (according to memory occupied by int) it should store more. Can anybody help me, 1) Why is this happening (means Multimap is taking lots of space) ? I checked my code with out inserting pairs in Multimap, it takes only 1/2 MB space. 2) Is there any other way or home-baked solution to solve this space issue ? More clearly, how to solve this memory issue ? Thanks in advance and any idea is perfectly OK for me.

    Read the article

  • java cannot reserver heap size error on windows server

    - by Prad
    HI, I have the following configuration: Server : windows 2003 server (32 bit) java version: 1.5_0_22 I get the following error when executing from command line ( my code is based off eclipse wihch gives the same error) java -XX:MaxPermSize=256m -Xmx512m Error occurred during initialization of VM Could not reserve enough space for object heap Could not create the Java virtual machine. The server has over 20GB physical memory with over 19 GB free right now. It does not give an error upto -Xmx486m I have read other articles about contiguous memory space. There is hardly anything running on this server. Can I validae this in any way? Thanks

    Read the article

  • In a virtual machine monitor such as VMware's ESXi Server, how are shadow page tables implemented?

    - by ali01
    My understanding is that VMMs such as VMware's ESXi Server maintain shadow page tables to map virtual page addresses of guest operating systems directly to machine (hardware) addresses. I've been told that shadow page tables are then used directly by the processor's paging hardware to allow memory access in the VM to execute without translation overhead. I would like to understand a bit more about how the shadow page table mechanism works in a VMM. Is my high level understanding above correct? What kind of data structures are used in the implementation of shadow page tables? What is the flow of control from the guest operating system all the way to the hardware? How are memory access translations made for a guest operating system before its shadow page table is populated? How is page sharing supported? Short of straight up reading the source code of an open source VMM, what resources can I look into to learn more about hardware virtualization?

    Read the article

  • What is the effect on record size of reordering columns in PostgreSQL?

    - by Summer
    Since Postgres can only add columns at the end of tables, I end up re-ordering by adding new columns at the end of the table, setting them equal to existing columns, and then dropping the original columns. So, what does PostgreSQL do with the memory that's freed by dropped columns? Does it automatically re-use the memory, so a single record consumes the same amount of space as it did before? But that would require a re-write of the whole table, so to avoid that, does it just keep a bunch of blank space around in each record? Thanks! ~S

    Read the article

  • App like default photo browser in iphone ?

    - by goeff27
    Hi All i am developing a app which contains feature like default photo browser in iphone. I done some what similar to that. but after loading some(near about 10-15) images from remote server,i am receiving memory warning.My requirement is loading image one by one. For this, on scroll view i am putting an images and increasing the contentSize of scroll view. it will work fine. but due to memory warning app quite. Guys, any have any idea to approach for this feature which work similar to photo app without problem? thanks in advance .

    Read the article

  • data structure for counting frequencies in a database table-like format

    - by user373312
    i was wondering if there is a data structure optimized to count frequencies against data that is stored in a database table-like format. for example, the data comes in a (comma) delimited format below. col1, col2, col3 x, a, green x, b, blue ... y, c, green now i simply want to count the frequency of col1=x or col1=x and col2=green. i have been storing the data in a database table, but in my profiling and from empirical observation, database connection is the bottle-neck. i have tried using in-memory database solutions too, and that works quite well; the only problem is memory requirements and quirky init/destroy calls. also, i work mainly with java, but have experience with .net, and was wondering if there was any api to work with "tabular" data in a linq way using java. any help is appreciated.

    Read the article

  • Processing XML file with Huge data

    - by Manish Dhanotiya
    Hi,be m I am working on an application which has below requiements - 1. Download a ZIP file from a server. 2. Uncompress the ZIP file, get the content (which is in XML format) from this file into a String. 3. Pass this content into another method for parsing and further processing. Now, my concerns here is the XML file may be of Huge size say like '100MB', and my JVM has memory of only 512 MB, so how can I get this content into Chunks and pass for Parsing and then insert the data into PL/SQL tables. Since there can be multiple requests running at the same time and considering 512MB of memory what will be the best possible to process this. How I can get the data into Chunks and pass it as Stream for XML parsing. I googled on this, but didnt find any implementation. :( Thanks,

    Read the article

  • What is faster: multiple `send`s or using buffering?

    - by dauerbaustelle
    I'm playing around with sockets in C/Python and I wonder what is the most efficient way to send headers from a Python dictionary to the client socket. My ideas: use a send call for every header. Pros: No memory allocation needed. Cons: many send calls -- probably error prone; error management should be rather complicated use a buffer. Pros: one send call, error checking a lot easier. Cons: Need a buffer :-) malloc/realloc should be rather slow and using a (too) big buffer to avoid realloc calls wastes memory. Any tips for me? Thanks :-)

    Read the article

  • Switching from C++ (with a lot of STL use) to C for interpreter building

    - by wndsr
    I'm switching from C++ to C because I'm rebuilding my toy interpreter. I was used to vectors for dynamic allocation of objects like tokens or instructions of my programs, stacks and mainly strings with all their aspects. Now, in C I'm not going to have all these anymore. I know that I will have to use a lot of memory management, too. I'm completely new to C, I only know the high-level easy-life data structures from the STL, how can I get started with strings and dynamic memory allocation?

    Read the article

  • Allocation Target of std::aligned_storage (stack or heap?)

    - by Zenikoder
    I've been trying to get my head around the TR1 addition known as aligned_storage. Whilst reading the following documents N2165, N3190 and N2140 I can't for the life of me see a statement where it clearly describes stack or heap nature of the memory being used. I've had a look at the implementation provided by msvc2010, boost and gcc they all provide a stack based solution centered around the use of a union. In short: Is the memory type (stack or heap) used by aligned_storage implementation defined or is it always meant to be stack based? and, What the is the specific document that defines/determines that?

    Read the article

  • Search in big text log files

    - by 0xFF
    Hi, let's say you have an game server which creating text log files of gamers actions, and from time to time you need to lookup something in those logs files (like investigating an scam or loosing an item). Just for example you have 100 files and each file have size between 20MB and 50MB - How you would search them quickly? What I have already tried to do is create several threads and each invidual thread will map his own file to memory (let say memory should not be problem if it not exceed 500MB of ram) perform search here, result was something around 1 second per file : File:a26.log - read in: 0.891, lines: 625282, matches: 78848 Is there better way how to do that ? - because it seems to me kinda slow. thanks. (java was used for this case)

    Read the article

  • c++ std::ostringstream vs std::string::append

    - by NickSoft
    In all examples that use some kind of buffering I see they use stream instead of string. How is std::ostringstream and << operator different than using string.append. Which one is faster and which one uses less resourses (memory). One difference I know is that you can output different types into output stream (like integer) rather than the limited types that string::append accepts. Here is an example: std::ostringstream os; os << "Content-Type: " << contentType << ";charset=" << charset << "\r\n"; std::string header = os.str(); vs std::string header("Content-Type: "); header.append(contentType); header.append(";charset="); header.append(charset); header.append("\r\n"); Obviously using stream is shorter, but I think append returns reference to the string so it can be written like this: std::string header("Content-Type: "); header.append(contentType) .append(";charset=") .append(charset) .append("\r\n"); And with output stream you can do: std::string content; ... os << "Content-Length: " << content.length() << "\r\n"; But what about memory usage and speed? Especially when used in a big loop. Update: To be more clear the question is: Which one should I use and why? Is there situations when one is preferred or the other? For performance and memory ... well I think benchmark is the only way since every implementation could be different. Update 2: Well I don't get clear idea what should I use from the answers which means that any of them will do the job, plus vector. Cubbi did nice benchmark with the addition of Dietmar Kühl that the biggest difference is construction of those objects. If you are looking for an answer you should check that too. I'll wait a bit more for other answers (look previous update) and if I don't get one I think I'll accept Tolga's answer because his suggestion to use vector is already done before which means vector should be less resource hungry.

    Read the article

  • What would happen to GC if I run process with priority = RealTime?

    - by Bobb
    I have a C# app which runs with priority RealTime. It was all fine until I made few hectic changes in past 2 days. Now it runs out of memory in few hours. I am trying to find whether it is a memory leak I created of this is because I consume lot more objects than before and GC simply cant collect them because it runs with same priority. My question is - what could happen to GC when it tries to collect objects in application with RealTime priority (there is also at least one thread running with Highest thread priority)? (P.S. by realtime priority I mean Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.RealTime) Sorry forgot to tell. GC is in Server mode

    Read the article

  • How can I detect endianness on a system where all primitive integer sizes are the same?

    - by Joe Wreschnig
    (This question came out of explaining the details of CHAR_BIT, sizeof, and endianness to someone yesterday. It's entirely hypothetical.) Let's say I'm on a platform where CHAR_BIT is 32, so sizeof(char) == sizeof(short) == sizeof(int) == sizeof(long). I believe this is still a standards-conformant environment. The usual way to detect endianness at runtime (because there is no reliable way to do it at compile time) is to make a union { int i, char c[sizeof(int)] } x; x.i = 1 and see whether x.c[0] or x.c[sizeof(int)-1] got set. But that doesn't work on this platform, as I end up with a char[1]. Is there a way to detect whether such a platform is big-endian or little-endian, at runtime? Obviously it doesn't matter inside this hypothetical system, but one can imagine it is writing to a file, or some kind of memory-mapped area, which another machine reads and reconstructs it according to its (saner) memory model.

    Read the article

  • Sound Manager Classes for Windows (C# or C++ .Net 2.0)

    - by Yakov
    Hi guys! I need some classes for playing short wav sounds, this classes would load this wav files into memory when an instance created, play sounds in background when needed, release this wav files from memory when an instance disposed. How can I do this on C# for windows (.Net 2.0)? (Win API's sndPlaySound, OpenAL or may be any wrapper) Ideally I would love to find an exist solution that simple and able to solve my task. Do you know any solutions for this issue? Thankx for your time.

    Read the article

  • Does JavaScript have an equivalent to Perl's DESTROY method?

    - by Eric Strom
    Is there any method that is called or event that is dispatched right before an Element is cleaned up by the JavaScript garbage collector? In Perl I would write: package MyObj; sub new {bless {}} sub DESTROY {print "cleaning up @_\n"} and then later: { my $obj = MyObj->new; # do something with obj } # scope ends, and assuming there are no external references to $obj, # the DESTROY method will be called before the object's memory is freed My target platform is Firefox (and I have no need to support other browsers), so if there is only a Firefox specific way of doing this, that is fine. And a little background: I am writing the Perl module XUL::Gui which serves as a bridge between Perl and Firefox, and I am currently working on plugging a few memory leaks related to DOM Elements sticking around forever, even after they are gone and no more references remain on the Perl side. So I am looking for ways to either figure out when JavaScript Elements will be destroyed, or a way to force JavaScript to cleanup an object.

    Read the article

  • [MySQL, InnoDb] Rating place

    - by Pavel
    I'm trying to generate rating place table using following receipt http://stackoverflow.com/questions/1776821/assign-places-in-the-rating-mysql-php but my database is high loaded. I tried not to create table, but use MEMORY TABLE and update it using following SQL query insert into tops (uid) select uid from users order by exp desc; but got the following MySQL error Deadlock found when trying to get lock; try restarting transaction because there are too many queries until SQL select is being executed. How to solve this problem? P.S. CREATE TABLE tops as SELECT work almost fine except high server load... up to load average: 50 if tops are non-memory table. My table users has near 4.5 millions of rows. Thanks for any advices.

    Read the article

  • Creating an Application to Save Arbitrary Application State

    - by ashes999
    See this SuperUser question. To summarize, VM software lets you save state of arbitrary applications (by saving the whole VM image). Would it be possible to write some software for Windows that allows you to save and reload arbitrary application state? If so (and presumably so), what would it entail? I would be looking to implement this, if possible, in a high-level language like C#. I presume if I used something else, I would need to dump memory registers (or maybe dump the entire application memory block) to a file somewhere and load it back somewhere to refresh state. So how do I build this thing?

    Read the article

  • Complexity in using Binary search and Trie

    - by user121196
    given a large list of alphabetically sorted words in a file,I need to write a program that, given a word x, determines if x is in the list. Preprocessing is ok since I will be calling this function many times over different inputs. priorties: 1. speed. 2. memory I already know I can use (n is number of words, m is average length of the words) 1. a trie, time is O(log(n)), space(best case) is O(log(n*m)), space(worst case) is O(n*m). 2. load the complete list into memory, then binary search, time is O(log(n)), space is O(n*m) I'm not sure about the complexity on tri, please correct me if they are wrong. Also are there other good approaches?

    Read the article

  • Is there a class like a Dictionary without a Value template? Is HashSet<T> the correct answer?

    - by myotherme
    I have 3 tables: Foos, Bars and FooBarConfirmations I want to have a in-memory list of FooBarConfirmations by their hash: FooID BarID Hash 1 1 1_1 2 1 2_1 1 2 1_2 2 2 2_2 What would be the best Class to use to store this type of structure in-memory, so that I can quickly check to see if a combination exists like so: list.Contains("1_2"); I can do this with Dictionary<string,anything>, but it "feels" wrong. HashSet looks like the right tool for the job, but does it use some form of hashing algorithm in the background to do the lookups efficiently?

    Read the article

  • C# What would happen to GC if I run process with priority = RealTime?

    - by Bobb
    I have a C# app which runs with priority RealTime. It was all fine until I made few hectic changes in past 2 days. Now it runs out of memory in few hours. I am trying to find whether it is a memory leak I created of this is because I consume lot more objects than before and GC simply cant collect them because it runs with same priority. My question is - what could happen to GC when it tries to collect objects in application with RealTime priority (there is also at least one thread running with Highest thread priority)? (P.S. by realtime priority I mean Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.RealTime)

    Read the article

  • 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

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