Search Results

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

Page 281/491 | < Previous Page | 277 278 279 280 281 282 283 284 285 286 287 288  | Next Page >

  • How to share classes between DLLs

    - by Jamie Hale
    I have an unmanaged Win32 C++ application that uses multiple C++ DLLs. The DLLs each need to use class Foo - definition and implementation. Where do Foo.h and Foo.cpp live so that the DLLs link and don't end up duplicating code in memory? Is this a reasonable thing to do?

    Read the article

  • Stack Overflow problem in a recursive program in C

    - by Adi
    Hi all, I am getting a stack overflow in one of the recursive functions i am running.. Here is the code.. void* buddyMalloc(int req_size) { // Do something here return buddy_findout(original_index,req_size); // This is the recursive call } void *buddy_findout(int current_index,int req_size) { char *selected = NULL; if(front!=NULL) { if(current_index==original_index) { // Do something here return selected; } else { // Do Something here return buddy_findout(current_index+1,req_size); } } else { return buddy_findout(current_index-1,req_size); } } Consider the initial value of index to be 4. and it first do index-1 till it reaches 0 index. and then it comes back to index 4 by incrementing..This is wht i want to implement. But it gives a stack overflow with memory map in the command prompt : Here is the output from my shell : * glibc detected * ./473_mem: free(): invalid pointer: 0x00c274c0 * ======= Backtrace: ========= /lib/tls/i686/cmov/libc.so.6[0xb50ff1] /lib/tls/i686/cmov/libc.so.6[0xb526f2] /lib/tls/i686/cmov/libc.so.6(cfree+0x6d)[0xb557cd] ./473_mem[0x8048b44] ./473_mem[0x8048b74] ./473_mem[0x8048b74] ./473_mem[0x8048944] ./473_mem[0x8048c87] ./473_mem[0x8048d31] ./473_mem[0x8048f79] /lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe6)[0xafcb56] ./473_mem[0x8048671] ======= Memory map: ======== 0017c000-00198000 r-xp 00000000 08:01 5224 /lib/libgcc_s.so.1 00198000-00199000 r--p 0001b000 08:01 5224 /lib/libgcc_s.so.1 00199000-0019a000 rw-p 0001c000 08:01 5224 /lib/libgcc_s.so.1 00260000-00284000 r-xp 00000000 08:01 1927 /lib/tls/i686/cmov/libm-2.10.1.so 00284000-00285000 r--p 00023000 08:01 1927 /lib/tls/i686/cmov/libm-2.10.1.so 00285000-00286000 rw-p 00024000 08:01 1927 /lib/tls/i686/cmov/libm-2.10.1.so 006cd000-006e8000 r-xp 00000000 08:01 6662 /lib/ld-2.10.1.so 006e8000-006e9000 r--p 0001a000 08:01 6662 /lib/ld-2.10.1.so 006e9000-006ea000 rw-p 0001b000 08:01 6662 /lib/ld-2.10.1.so 00aa9000-00aaa000 r-xp 00000000 00:00 0 [vdso] 00ae6000-00c24000 r-xp 00000000 08:01 1900 /lib/tls/i686/cmov/libc-2.10.1.so 00c24000-00c25000 ---p 0013e000 08:01 1900 /lib/tls/i686/cmov/libc-2.10.1.so 00c25000-00c27000 r--p 0013e000 08:01 1900 /lib/tls/i686/cmov/libc-2.10.1.so 00c27000-00c28000 rw-p 00140000 08:01 1900 /lib/tls/i686/cmov/libc-2.10.1.so 00c28000-00c2b000 rw-p 00000000 00:00 0 08048000-0804a000 r-xp 00000000 00:14 2176 /media/windows-share/OS/Project2/473_mem 0804a000-0804b000 r--p 00001000 00:14 2176 /media/windows-share/OS/Project2/473_mem 0804b000-0804c000 rw-p 00002000 00:14 2176 /media/windows-share/OS/Project2/473_mem 08483000-084a4000 rw-p 00000000 00:00 0 [heap] b7600000-b7621000 rw-p 00000000 00:00 0 b7621000-b7700000 ---p 00000000 00:00 0 b7716000-b7819000 rw-p 00000000 00:00 0 b7827000-b782a000 rw-p 00000000 00:00 0 bfb96000-bfbab000 rw-p 00000000 00:00 0 [stack] Aborted Thanks in advance adi

    Read the article

  • Populate Multiple PDFs

    - by gmcalab
    I am using itextsharp to populate my PDFs. I have no issues with this. Basically what I am doing is getting the PDF and populating the fields in memory then passing back the MemoryStream to be displayed on a webpage. All this is working with a single document PDF. What I am trying to figure out now, is merging multiple PDFs into one MemoryStream. The part I cant figure out is, the documents I am populating are identical. So for example, I have a List<Person> that contains 5 persons. I want to fill out a PDF for each person and merge them all into one, in memory. Bare in mind I am going to fill out the same type of document for each person. The problem I am getting is that when I try to add a second copy of the same PDF to be filled out for the second iteration, it just overwrites the first populated PDF, since it's the same document, therefore not adding a second copy for the second Person at all. So basically if I had the 5 people, I would end up with a single page with the data of the 5th person, instead of a PDF with 5 like pages that contain the data of each person respectively. Here's some code... MemoryStream ms = ms = new MemoryStream(); PdfReader docReader = null; PdfStamper Stamper = null; List<Person> persons = new List<Person>() { new Person("Larry", "David"), new Person("Dustin", "Byfuglien"), new Person("Patrick", "Kane"), new Person("Johnathan", "Toews"), new Person("Marian", "Hossa") }; try { // Iterate thru all persons and populate a PDF for each foreach(var person in persons){ PdfCopyFields Copier = new PdfCopyFields(ms); Copier.AddDocument(GetReader("Person.pdf")); Copier.Close(); docReader = new PdfReader(ms.ToArray()); Stamper = new PdfStamper(docReader, ms); AcroFields Fields = Stamper.AcroFields; Fields.SetField("FirstName", person.FirstName); } }catch(Exception e){ // handle error }finally{ if (Stamper != null) { Stamper.Close(); } if (docReader != null) { docReader.Close(); } }

    Read the article

  • Executing procedural queries in perl

    - by KalpaG
    I have a query like this set @valid_total:=0; set @invalid_total:=0; select week as weekno, measured_week,project_id as project, role_category_id as role_category, valid_count,valid_tickets, (@valid_total := @valid_total + valid_count) as valid_total, invalid_count,invalid_tickets, (@invalid_total := @invalid_total + invalid_count) as invalid_total from metric_fault_bug_project where measured_week = yearweek(curdate()) and role_category_id = 1 and project_id = 11; it executes fine in heidi (MySQL client) but when it comes to perl, it gives me this error DBD::mysql::st execute failed: You have an error in your SQL syntax; check the m anual that corresponds to your MySQL server version for the right syntax to use near ':=0; set :=0; select week as weekno, measured_week,project_id as project' at line 1 at D:\Mx\scripts\test.pl line 35. Can't execute SQL statement: You have an error in your SQL syntax; check the man ual that corresponds to your MySQL server version for the right syntax to use ne ar ':=0; set :=0; select week as weekno, measured_week,project_id as project' at line 1 The problem seem to be in the set @valid_total := 0; line. I am fairly new to Perl. Can anyone help? this is the complete perl code #!/usr/bin/perl #use lib '/x01/home/kalpag/libs'; use DBI; use strict; use warnings; my $sid = 'issues'; my $user = 'root'; my $passwd = 'kalpa'; my $connection = "DBI:mysql:database=$sid;host=localhost"; my $dbhh = DBI->connect( $connection, $user, $passwd) || die "Database connection not made: $DBI::errstr"; my $sql_query = 'set @valid_total:=0; set @invalid_total:=0; select week as weekno, measured_week,project_id, role_category_id as role_category, valid_count,valid_tickets, (@valid_total := @valid_total + valid_count) as valid_total, invalid_count,invalid_tickets, (@invalid_total := @invalid_total + invalid_count) as invalid_total from metric_fault_bug_project where measured_week = yearweek(curdate()) and role_category_id = 1 and project_id = 11'; my $sth = $dbhh->prepare($sql_query) or die "Can't prepare SQL statement: $DBI::errstr\n"; $sth->execute() or die "Can't execute SQL statement: $DBI::errstr\n"; while ( my @memory = $sth->fetchrow() ) { print "@memory \n"; }

    Read the article

  • Google Analytics without ga.js

    - by Andrew
    I can't find anything recent on this. Is there any documentation on how to track with Google Analytics without using ga.js? I want a JS implementation on mobile devices but I don't want to load up 9KB of local memory or use server-side GA. I'm primarily interested only in tracking page views and uniques. Has anyone rolled their own GA implementation?

    Read the article

  • Mapkit: Only show annotations in current view

    - by Nic Hubbard
    Instead of loading all annotations that are in my array, I would only like to load the annotations that the user could currently see cased on how far they are zoomed in on the map. So, if the user pans to a place where there are annotations, those would be added, and if they pan away, those would be removed. I assume this would help with memory. Does anyone know how to do something like this? And, is it worth it, or needed?

    Read the article

  • PHP: optimum configuration storage ?

    - by Jerome WAGNER
    Hello, My application gets configured via a lot of key/values (let's say 30.000 for instance) I want to find the best deployment method for these configurations, knowing that I want to avoid DEFINEs to allow for runtime re-configuration. I have thought of - pre-compiling them into an array via a php file - pre-compiling them into a tmpfs sqlite database - pre-compiling them into a memcached db what are my options for the best random access time to these configuration (memory is not an issue) ? Thanks Jerome

    Read the article

  • Garbage collection in Perl

    - by srikfreak
    Unlike Java, Perl uses reference count for garbage collection. I have tried searching some previous questions which speak about C++ RAII and smart pointers and Java GC but have not understood how Perl deals with the circular referencing problem. Can anyone explain how Perl's garbage collector deals with circular references? Is there any way to reclaim circular referenced memory which are no longer used by the program or does Perl just ignores this problem altogether?

    Read the article

  • Differnce between linux write and sendfile syscall

    - by JosiP
    Hi Im programming webserver (C), which should send big files. My question is: What are the main differneces in two syscalls: write and sendfile. Does sendfile depends on size of socket system buffer ? I noticed that write often writes less then i requested. For example, if got many requests for one file: should i open it, copy into memory and use 'write', or maybe i can do 'sendfile' for each client ? thx in advance for all answers

    Read the article

  • Lazy load pages in UIScrollView

    - by jean
    I have a UIScrollView that contains large images and am using paging to scroll between images. In order to save memory, I am loading only one image before and after the currently visible one and loading/releasing new images after a scroll has completed. The problem occurs when one scrolls quickly and scrollViewDidEndDecelerating is not called. How can I detect continuous scrolling? I could check item location on every scrollViewDidScroll but this seems a bit heavy...

    Read the article

  • Should I worry about circular references in Python?

    - by bodacydo
    Suppose I have code that maintains parent/children structure. In such a structure I get circular references, where child points to parent and parent points to child. Should I worry about them? I'm using Python 2.5. I am concerned that they will not be garbage collected and the application will eventually consume all memory. Thanks, Boda Cydo.

    Read the article

  • How to simulate a USB drive

    - by rursw1
    Hi all, Is it possible to simulate a USB drive with software only? I mean, for example, to expose a local memory space to the OS so the device manager will recognize it as a USB device. I'm not familiar with hardware implementation, but I'm sure that it is possible somehow to emulate the USB protocol. I began with this book - USB Design By Example. Can anyone please give me additional references to begin with? Thank in advance!

    Read the article

  • Remove an element from an xml File using jdom

    - by Llistes Sugra
    I have a 300 KB xml file with 70 elements in it. I need to be efficient upon removing one of the root's elements. What is the best approach? Should I detach the element in memory, save it and overwrite it by moving it? Is there a better option? I like org.jdom but any improvement is welcome

    Read the article

  • WPF Graph Layout Component

    - by Jörg B.
    Does anyone know of or even better.. can wholeheartedly recommend a WPF graph layout component (Microsoft Research had GLEE a while back but it hasn't been updated after 1.0 since 2007 and isn't WPF etc) as seen e.g. in the screenshot below? I've seen yFiles WPF and Lasalle's AddFlow for WPF, but are there any alternatives? (c) Screenshot: RedGate Ants Memory Profiler

    Read the article

  • Benefit of using multiple SIMD instruction sets simultaneously

    - by GenTiradentes
    I'm writing a highly parallel application that's multithreaded. I've already got an SSE accelerated thread class written. If I were to write an MMX accelerated thread class, then run both at the same time (one SSE thread and one MMX thread per core) would the performance improve noticeably? I would think that this setup would help hide memory latency, but I'd like to be sure before I start pouring time into it.

    Read the article

  • iPhone App runtime error- "Error: Embedded profile header length is greater than data length.\n"

    - by Rob Lourens
    This error Thu Apr 8 20:24:15 iPod-touch appname[947] <Error>: Error: Embedded profile header length is greater than data length.\n Thu Apr 8 20:24:16 iPod-touch appname[947] <Error>: Error: Embedded profile header length is greater than data length.\n is logged when a UIImageView is loaded. The view isn't huge but it has a few other UIImageViews as subviews and it might be related to memory, but I can't find anything on this message. Any ideas?

    Read the article

  • Caveats of select/poll vs. epoll reactors in Twisted

    - by David
    Everything I've read and experienced ( Tornado based apps ) leads me to believe that ePoll is a natural replacement for Select and Poll based networking, especially with Twisted. Which makes me paranoid, its pretty rare for a better technique or methodology not to come with a price. Reading a couple dozen comparisons between epoll and alternatives shows that epoll is clearly the champion for speed and scalability, specifically that it scales in a linear fashion which is fantastic. That said, what about processor and memory utilization, is epoll still the champ?

    Read the article

  • Terminating suspended NSTask.

    - by Jef
    Hi, If I terminate (or interrupt) a suspended NSTask, then it still shows up in activity monitor. It isn't running because the CPU is 0% but it's still taking up memory. Is there a work around?

    Read the article

  • va_list crash bug from hell

    - by Jonas Byström
    I'm getting crashes due to memory overwrites (possibly within STLport) running on Darwin. Totally out of ideas, what to do? (Added this question so no-one else would run into the same trap without finding a viable answer.)

    Read the article

  • OpenGL ES depth buffer

    - by Istvan
    Hi! I was wondering if I can deallocate the depth buffer in iPhone OpenGL ES to conserve memory? Or it stays until the application finishes? I only need the depth testing in the beginning of the application.

    Read the article

  • Does Marshal.ReleaseComObject call the garbage collector ?

    - by Shimrod
    Hi, I was asked this question today by a colleague, and couldn't find any clue on the Internet... Can someone tell me if calling Marshall.ReleaseComObject()directly calls the garbage collector ? As I understand it, it only removes COM references, and then the G.C. cleans memory on its next pass, but I can be mistaken... Thanks in advance for your help!

    Read the article

< Previous Page | 277 278 279 280 281 282 283 284 285 286 287 288  | Next Page >