Search Results

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

Page 129/491 | < Previous Page | 125 126 127 128 129 130 131 132 133 134 135 136  | Next Page >

  • Slow insert speed in Postgresql memory tablespace

    - by Prashant
    Hi, I have a requirement where I need to store the records at rate of 10,000 records/sec into a database (with indexing on a few fields). Number of columns in one record is 25. I am doing a batch insert of 100,000 records in one transaction block. To improve the insertion rate, I changed the tablespace from disk to RAM.With that I am able to achieve only 5,000 inserts per second. I have also done the following tuning in the postgres config: Indexes : no fsync : false logging : disabled Other information: - Tablespace : RAM - Number of columns in one row : 25 (mostly integers) - CPU : 4 core, 2.5 GHz - RAM : 48 GB I am wondering why a single insert query is taking around 0.2 msec on average when database is not writing anything on disk (as I am using RAM based tablespace). Is there something I am doing wrong? Help appreciated. Prashant

    Read the article

  • In-Memory SQL-CE

    - by harley.333
    Is there a way to connect to a SQL-CE database as a stream? Specifically, our ASP.Net application builds small SDF at runtime for off-line needs. When the user is done with his off-line duties, he uploads the SDF and the application imports the new and updated data. No problems there. Currently, we're saving the uploaded SDF to the web-server's hard-drive and connecting to the file. Can we connect to the uploaded SDF without saving it to the hard-drive? We are using the DbProviderFactory.CreateConnection method, but we're open to suggestions.

    Read the article

  • Memory leak in Qt signal and slots

    - by Ajay
    Hello, I am running valgrind on my Qt code,and even on successful exit of the application, get the following report from valgrind 8,832 bytes in 92 blocks are still reachable in loss record 12 of 12 at 0x4025390: operator new(unsigned int) (vg_replace_malloc.c:214) ==3339== by 0x4B75F05: QMutex::QMutex(QMutex::RecursionMode) (qmutex.cpp:123) ==3339== by 0x4B77602: QMutexPool::get(void const*) (qmutexpool.cpp:137) ==3339== by 0x4CA0EC2: signalSlotLock(QObject const*) (qobject.cpp:112) ==3339== by 0x4CA3939: QMetaObjectPrivate::connect(QObject const*, int, QObject const*, int, int, int*) (qobject.cpp:2900) ==3339== by 0x4CA5C00: QObject::connect(QObject const*, char const*, QObject const*, char const*, Qt::ConnectionType) (qobject.cpp:2599) I disconnect all signal connections and also delete the objects. The above mentioned leak increases if i increase the amount of signal and slot connections? Can anybody help with this?

    Read the article

  • Database which only holds indexes and last X records in memory?

    - by Xeoncross
    I'm looking for a data store that is very memory efficient while still allowing many object changes per second and disregarding ACID compliance for the last X records. I need this database for a server with not much memory and I can make a key-value store, document, or SQL database work. The idea is that indexes/keys are the only thing I need in memory and all the actual values/objects/rows can be saved on disk do to the low read rate (I just want index/key lookup to be fast). I also don't want records constantly being flushed to disk, so I would like the last X number of records to be held in memory so that 100 or so of them can all be written at once. I don't care if I lose the last 10 seconds worth of objects/values. I do care if the database as a whole is in danger of becoming corrupt. Is there a data-store like this?

    Read the article

  • Memory leak problem. iPhone SDK

    - by user326375
    Hello, i've got a problem, i cannot solve it, just recieving error: Program received signal: “0”. The Debugger has exited due to signal 10 (SIGBUS).The Debugger has exited due to signal 10 (SIGBUS). Here is some method, if i comment it out, problem goes aways - (void)loadTexture { const int num_tex = 10; glGenTextures(num_tex, &textures[0]); //TEXTURE #1 textureImage[0] = [UIImage imageNamed:@"wonder.jpg"].CGImage; //TEXTURE #2 textureImage[1] = [UIImage imageNamed:@"wonder.jpg"].CGImage; //TEXTURE #3 textureImage[2] = [UIImage imageNamed:@"wall_eyes.jpg"].CGImage; //TEXTURE #4 textureImage[3] = [UIImage imageNamed:@"wall.jpg"].CGImage; //TEXTURE #5 textureImage[4] = [UIImage imageNamed:@"books.jpg"].CGImage; //TEXTURE #6 textureImage[5] = [UIImage imageNamed:@"bush.jpg"].CGImage; //TEXTURE #7 textureImage[6] = [UIImage imageNamed:@"mushroom.jpg"].CGImage; //TEXTURE #8 textureImage[7] = [UIImage imageNamed:@"roots.jpg"].CGImage; //TEXTURE #9 textureImage[8] = [UIImage imageNamed:@"roots.jpg"].CGImage; //TEXTURE #10 textureImage[9] = [UIImage imageNamed:@"clean.jpg"].CGImage; for(int i=0; i<num_tex; i++) { NSInteger texWidth = CGImageGetWidth(textureImage[i]); NSInteger texHeight = CGImageGetHeight(textureImage[i]); GLubyte *textureData = (GLubyte *)malloc(texWidth * texHeight * 4); CGContextRef textureContext = CGBitmapContextCreate(textureData, texWidth, texHeight, 8, texWidth * 4, CGImageGetColorSpace(textureImage[i]), kCGImageAlphaPremultipliedLast); CGContextDrawImage(textureContext, CGRectMake(0.0, 0.0, (float)texWidth, (float)texHeight), textureImage[i]); CGContextRelease(textureContext); glBindTexture(GL_TEXTURE_2D, textures[i]); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, texWidth, texHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, textureData); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); free(textureData); } } anyone can help me with releasing/deleting objects in this method? Thanks.

    Read the article

  • Memory leak at Autorelease pool in Iphone sdk

    - by monish
    Hi guys, I am getting leak at [pool release]; My code here is: #pragma mark UISearchBarDelegate delegate methods - (void)performSearch:(UISearchBar *)aSearchBar { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; artistName= [aSearchBar.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; if ([artistName length] > 0) { [UIApplication sharedApplication].networkActivityIndicatorVisible = YES; LyricsAppDelegate* appDelegate = (LyricsAppDelegate*) [ [UIApplication sharedApplication] delegate]; artistsList=[appDelegate doSearch:artistName ]; [theTableView reloadData]; [UIApplication sharedApplication].networkActivityIndicatorVisible = NO; [UIApplication sharedApplication].networkActivityIndicatorVisible = NO; [aSearchBar resignFirstResponder]; } else { [aSearchBar resignFirstResponder]; } [NSThread exit]; [pool release]; } - (void)searchBarSearchButtonClicked:(UISearchBar *)aSearchBar { @try { [NSThread detachNewThreadSelector:@selector(performSearch:) toTarget:self withObject:aSearchBar]; [aSearchBar resignFirstResponder]; } @catch (NSException * e) { NSLog(@"\n caught an exception"); } @finally { } } Here I am getting leak at [pool release]; in performSearch method. How can I solve this. Anyone's help will be much appreciated. Thank you, Monish.

    Read the article

  • Redis, it's memory limit and persistance question?

    - by Kirzilla
    Hello, I'm rather new to Redis and before using it I'd like to learn some important (as for me) details on it. So.... Redis is using RAM and HDD for storing data. RAM is used as fast read/write storage, HDD is used to make this data persistant. When Redis is started it loads all data from HDD to RAM or it loads only often queried data to the RAM? What if I have 500Mb Redis storage on HDD, but I have only 100Mb or RAM for Redis. Where can I read about it? Thank you PS: Sorry for my English

    Read the article

  • Read vector into CUDA shared memory

    - by Ben
    I am new to CUDA and programming GPUs. I need each thread in my block to use a vector of length ndim. So I thought I might do something like this: extern __shared__ float* smem[]; ... if (threadIddx.x == 0) { for (int d=0; d<ndim; ++d) { smem[d] = vector[d]; } } __syncthreads(); ... This works fine. However, I seems wasteful that a single thread should do all loading, so I changed the code to if (threadIdx.x < ndim) { smem[threadIdx.x] = vector[threadIdx.x]; } __syncthreads(); which does not work. Why? It gives different results than the above code even when ndim << blockDim.x.

    Read the article

  • Why does Google Reader use up so much memory?

    - by Ivo
    I'm running the dev version of Chrome and just found out I could see the memory usage of every tab (press shift + ESC to find out yourself). Turns out the Shockwave Flash plugin uses 240 MB of memory and 27% of CPU while having open Google Reader. Killing this page brings it down to 50 MB. I reckon it builts up after reading through about 100 feeds. So my question is: why does it take up so much memory and what should I do to diminish it? Why I care? I often don't restart my browser (or laptop for that matter) and keep the Google Reader tab open for long periods of time. The memory does start to add up that way. Plus I have the feeling, perhaps incorrect, that it slows things down as well looking at the CPU usage. Side note: using Chrome 4 on Windows 7 (32 bit)

    Read the article

  • Objective-C Memory Question

    - by Winder
    Is it a leak if I have a view controller and allocate the view like this: self.view = [[UIView alloc] initWithFrame:frame]; Do I need to do something like this: UIView *v = [[UIView alloc] initWithFrame:frame]; self.view = v; [v release];

    Read the article

  • imageWithCGImage and memory

    - by Adam Ernst
    If I use [UIImage imageWithCGImage:], passing in a CGImageRef, do I then release the CGImageRef or does UIImage take care of this itself when it is deallocated? The documentation isn't entirely clear. It says "This method does not cache the image object." Originally I called CGImageRelease on the CGImageRef after passing it to imageWithCGImage:, but that caused a malloc_error_break warning in the Simulator claiming a double-free was occurring.

    Read the article

  • Memory over-release problem when I am animating UIView

    - by Sheehan Alam
    I have enabled NSZombie's and I am getting the following message in my console when I am running my application: *** -[UIViewAnimationState release]: message sent to deallocated instance 0xf96d7e0 Here is the method that is performing the animation -(void)loadAvatar:(STObject*)st { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; avatar.alpha = 0; avatar.frame = avatarRectSmall; avatar.image = [ImageCache getMemoryCachedImageAtUrl:st.avatar_url]; [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:.50]; avatar.frame = avatarRectNormal; [avatar setAlpha:1]; [UIView commitAnimations]; [pool release]; pool = nil; } I don't always get a crash, only sometimes. I'm wondering what is getting released?

    Read the article

  • calling concurrently Graphics.Draw and new Bitmap from memory in thread take long time

    - by Abdul jalil
    Example1 public partial class Form1 : Form { public Form1() { InitializeComponent(); pro = new Thread(new ThreadStart(Producer)); con = new Thread(new ThreadStart(Consumer)); } private AutoResetEvent m_DataAvailableEvent = new AutoResetEvent(false); Queue<Bitmap> queue = new Queue<Bitmap>(); Thread pro; Thread con ; public void Producer() { MemoryStream[] ms = new MemoryStream[3]; for (int y = 0; y < 3; y++) { StreamReader reader = new StreamReader("image"+(y+1)+".JPG"); BinaryReader breader = new BinaryReader(reader.BaseStream); byte[] buffer=new byte[reader.BaseStream.Length]; breader.Read(buffer,0,buffer.Length); ms[y] = new MemoryStream(buffer); } while (true) { for (int x = 0; x < 3; x++) { Bitmap bmp = new Bitmap(ms[x]); queue.Enqueue(bmp); m_DataAvailableEvent.Set(); Thread.Sleep(6); } } } public void Consumer() { Graphics g= pictureBox1.CreateGraphics(); while (true) { m_DataAvailableEvent.WaitOne(); Bitmap bmp = queue.Dequeue(); if (bmp != null) { // Bitmap bmp = new Bitmap(ms); g.DrawImage(bmp,new Point(0,0)); bmp.Dispose(); } } } private void pictureBox1_Click(object sender, EventArgs e) { con.Start(); pro.Start(); } } when Creating bitmap and Drawing to picture box are in seperate thread then Bitmap bmp = new Bitmap(ms[x]) take 45.591 millisecond and g.DrawImage(bmp,new Point(0,0)) take 41.430 milisecond when i make bitmap from memoryStream and draw it to picture box in one thread then Bitmap bmp = new Bitmap(ms[x]) take 29.619 and g.DrawImage(bmp,new Point(0,0)) take 35.540 the code is for Example 2 is why it take more time to draw and bitmap take time in seperate thread and how to reduce the time when processing in seperate thread. i am using ANTS performance profiler 4.3 public Form1() { InitializeComponent(); pro = new Thread(new ThreadStart(Producer)); con = new Thread(new ThreadStart(Consumer)); } private AutoResetEvent m_DataAvailableEvent = new AutoResetEvent(false); Queue<MemoryStream> queue = new Queue<MemoryStream>(); Thread pro; Thread con ; public void Producer() { MemoryStream[] ms = new MemoryStream[3]; for (int y = 0; y < 3; y++) { StreamReader reader = new StreamReader("image"+(y+1)+".JPG"); BinaryReader breader = new BinaryReader(reader.BaseStream); byte[] buffer=new byte[reader.BaseStream.Length]; breader.Read(buffer,0,buffer.Length); ms[y] = new MemoryStream(buffer); } while (true) { for (int x = 0; x < 3; x++) { // Bitmap bmp = new Bitmap(ms[x]); queue.Enqueue(ms[x]); m_DataAvailableEvent.Set(); Thread.Sleep(6); } } } public void Consumer() { Graphics g= pictureBox1.CreateGraphics(); while (true) { m_DataAvailableEvent.WaitOne(); //Bitmap bmp = queue.Dequeue(); MemoryStream ms= queue.Dequeue(); if (ms != null) { Bitmap bmp = new Bitmap(ms); g.DrawImage(bmp,new Point(0,0)); bmp.Dispose(); } } } private void pictureBox1_Click(object sender, EventArgs e) { con.Start(); pro.Start(); }

    Read the article

  • Possible memory leak problem

    - by MaiTiano
    I write two pieces of c programs like following, during memcheck process using Valgrind, a lot of mem leak information is given. int GetMemory(int framewidth, int frameheight, int SR/*, int blocksize*//*,int ALL_REF_NUM*/) { //int i,j; int memory_size = 0; //int refnum = ALL_REF_NUM; int input_search_range = SR; memory_size += get_mem2D(&curFrameY, frameheight, framewidth); memory_size += get_mem2D(&curFrameU, frameheight>>1, framewidth>>1); memory_size += get_mem2D(&curFrameV, frameheight>>1, framewidth>>1); memory_size += get_mem3D(&prevFrameY, refnum, frameheight, framewidth);// to allocate reference frame buffer accoding to the reference frame number memory_size += get_mem3D(&prevFrameU, refnum, frameheight>>1, framewidth>>1); memory_size += get_mem3D(&prevFrameV, refnum, frameheight>>1, framewidth>>1); memory_size += get_mem2D(&mpFrameY, frameheight, framewidth); memory_size += get_mem2D(&mpFrameU, frameheight>>1, framewidth>>1); memory_size += get_mem2D(&mpFrameV, frameheight>>1, framewidth>>1); memory_size += get_mem2D(&searchwindow, input_search_range*2 + blocksize, input_search_range*2 + blocksize);// to allocate search window according to the searchrange /*memory_size +=*/ get_mem1D(/*&SAD_cost, height, width*/); // memory_size += get_mem2D(&searchwindow, 80, 80);// if searchrange is 32, then only 32+1+32+15 pixels is needed in each row and col, therefore the range of // search window is enough to be set to 80 ! memory_size += get_mem2Dint(&all_mv, height/blocksize, width/blocksize); return 0; } void FreeMemory(int refno) { free_mem2D(curFrameY); free_mem2D(curFrameU); free_mem2D(curFrameV); free_mem3D(prevFrameY,refno); free_mem3D(prevFrameU,refno); free_mem3D(prevFrameV,refno); free_mem2D(mpFrameY); free_mem2D(mpFrameU); free_mem2D(mpFrameV); free_mem2D(searchwindow); free_mem1D(); free_mem2Dint(all_mv); } void free_mem1D() { free(SAD_cost); } Now I hope to make sure where are the possible problems in my program? Here I may post some valgrind information to let you know about the actual error information. ==29105== by 0x804A906: main (me_search.c:1480) ==29105== ==29105== ==29105== HEAP SUMMARY: ==29105== in use at exit: 124,088 bytes in 18 blocks ==29105== total heap usage: 37 allocs, 21 frees, 749,276 bytes allocated ==29105== ==29105== 272 bytes in 1 blocks are still reachable in loss record 1 of 18 ==29105== at 0x402425F: calloc (vg_replace_malloc.c:467) ==29105== by 0x804A296: get_mem2D (me_search.c:1315) ==29105== by 0x804885E: GetMemory (me_search.c:117) ==29105== by 0x804A757: main (me_search.c:1456) ==29105== ==29105== 352 bytes in 1 blocks are still reachable in loss record 2 of 18 ==29105== at 0x4024F20: malloc (vg_replace_malloc.c:236) ==29105== by 0x409537E: __fopen_internal (iofopen.c:76) ==29105== by 0x409544B: fopen@@GLIBC_2.1 (iofopen.c:107) ==29105== by 0x804A660: main (me_search.c:1439) ==29105== ==29105== 584 bytes in 1 blocks are still reachable in loss record 3 of 18 ==29105== at 0x402425F: calloc (vg_replace_malloc.c:467) ==29105== by 0x804A296: get_mem2D (me_search.c:1315) ==29105== by 0x8048724: GetMemory (me_search.c:106) ==29105== by 0x804A757: main (me_search.c:1456) ==29105== ==29105== 584 bytes in 1 blocks are still reachable in loss record 4 of 18 ==29105== at 0x402425F: calloc (vg_replace_malloc.c:467) ==29105== by 0x804A296: get_mem2D (me_search.c:1315) ==29105== by 0x8048747: GetMemory (me_search.c:107) ==29105== by 0x804A757: main (me_search.c:1456) ==29105== ==29105== 584 bytes in 1 blocks are still reachable in loss record 5 of 18 ==29105== at 0x402425F: calloc (vg_replace_malloc.c:467) ==29105== by 0x804A296: get_mem2D (me_search.c:1315) ==29105== by 0x8048809: GetMemory (me_search.c:114) ==29105== by 0x804A757: main (me_search.c:1456) ==29105== ==29105== 584 bytes in 1 blocks are still reachable in loss record 6 of 18 ==29105== at 0x402425F: calloc (vg_replace_malloc.c:467) ==29105== by 0x804A296: get_mem2D (me_search.c:1315) ==29105== by 0x804882C: GetMemory (me_search.c:115) ==29105== by 0x804A757: main (me_search.c:1456) ==29105== ==29105== 584 bytes in 1 blocks are definitely lost in loss record 7 of 18 ==29105== at 0x402425F: calloc (vg_replace_malloc.c:467) ==29105== by 0x804A296: get_mem2D (me_search.c:1315) ==29105== by 0x804A4F8: get_mem3D (me_search.c:1393) ==29105== by 0x804879B: GetMemory (me_search.c:110) ==29105== by 0x804A757: main (me_search.c:1456) ==29105== ==29105== 584 bytes in 1 blocks are definitely lost in loss record 8 of 18 ==29105== at 0x402425F: calloc (vg_replace_malloc.c:467) ==29105== by 0x804A296: get_mem2D (me_search.c:1315) ==29105== by 0x804A4F8: get_mem3D (me_search.c:1393) ==29105== by 0x80487C9: GetMemory (me_search.c:111) ==29105== by 0x804A757: main (me_search.c:1456) ==29105== ==29105== 1,168 bytes in 1 blocks are still reachable in loss record 9 of 18 ==29105== at 0x402425F: calloc (vg_replace_malloc.c:467) ==29105== by 0x804A296: get_mem2D (me_search.c:1315) ==29105== by 0x8048701: GetMemory (me_search.c:105) ==29105== by 0x804A757: main (me_search.c:1456) ==29105== ==29105== 1,168 bytes in 1 blocks are still reachable in loss record 10 of 18 ==29105== at 0x402425F: calloc (vg_replace_malloc.c:467) ==29105== by 0x804A296: get_mem2D (me_search.c:1315) ==29105== by 0x80487E6: GetMemory (me_search.c:113) ==29105== by 0x804A757: main (me_search.c:1456) ==29105== ==29105== 1,168 bytes in 1 blocks are definitely lost in loss record 11 of 18 ==29105== at 0x402425F: calloc (vg_replace_malloc.c:467) ==29105== by 0x804A296: get_mem2D (me_search.c:1315) ==29105== by 0x804A4F8: get_mem3D (me_search.c:1393) ==29105== by 0x804876D: GetMemory (me_search.c:109) ==29105== by 0x804A757: main (me_search.c:1456) ==29105== ==29105== 6,336 bytes in 1 blocks are definitely lost in loss record 12 of 18 ==29105== at 0x4024F20: malloc (vg_replace_malloc.c:236) ==29105== by 0x804A25C: get_mem1D (me_search.c:1295) ==29105== by 0x8048866: GetMemory (me_search.c:119) ==29105== by 0x804A757: main (me_search.c:1456)

    Read the article

  • Permutations of Varying Size

    - by waiwai933
    I'm trying to write a function in PHP that gets all permutations of all possible sizes. I think an example would be the best way to start off: $my_array = array(1,1,2,3); Possible permutations of varying size: 1 1 // * See Note 2 3 1,1 1,2 1,3 // And so forth, for all the sets of size 2 1,1,2 1,1,3 1,2,1 // And so forth, for all the sets of size 3 1,1,2,3 1,1,3,2 // And so forth, for all the sets of size 4 Note: I don't care if there's a duplicate or not. For the purposes of this example, all future duplicates have been omitted. What I have so far in PHP: function getPermutations($my_array){ $permutation_length = 1; $keep_going = true; while($keep_going){ while($there_are_still_permutations_with_this_length){ // Generate the next permutation and return it into an array // Of course, the actual important part of the code is what I'm having trouble with. } $permutation_length++; if($permutation_length>count($my_array)){ $keep_going = false; } else{ $keep_going = true; } } return $return_array; } The closest thing I can think of is shuffling the array, picking the first n elements, seeing if it's already in the results array, and if it's not, add it in, and then stop when there are mathematically no more possible permutations for that length. But it's ugly and resource-inefficient. Any pseudocode algorithms would be greatly appreciated. Also, for super-duper (worthless) bonus points, is there a way to get just 1 permutation with the function but make it so that it doesn't have to recalculate all previous permutations to get the next? For example, I pass it a parameter 3, which means it's already done 3 permutations, and it just generates number 4 without redoing the previous 3? (Passing it the parameter is not necessary, it could keep track in a global or static). The reason I ask this is because as the array grows, so does the number of possible combinations. Suffice it to say that one small data set with only a dozen elements grows quickly into the trillions of possible combinations and I don't want to task PHP with holding trillions of permutations in its memory at once.

    Read the article

  • A queue in C using structs and dynamic memory allocation (linked list)

    - by Martin Pugh
    I am tasked with making a queue data structure in C, as a linked list. Our lecturer gave us a large amount of code to implement a stack, but we have to adapt it to create a queue. The code our lecturer gave us ends up not compiling and segfaulting at the exact same point as the code I wrote for the queue. I'm very new to structs, malloc and C in general, so there could be something painfully obvious I've overlooked. Here is the code I am using: #include <stdio.h> #include <stdlib.h> struct node{ int data; //contains the actual data struct node *prev; //pointer to previous node (Closer to front) struct node *next; //pointer to next node (Closer to back) }; typedef struct node *Nodepointer; struct queue{ Nodepointer front; Nodepointer back; }; typedef struct queue *Queuepointer; main(){ Queuepointer myqueue; //create a queue called myqueue init(myqueue); //initialise the queue Nodepointer new = (Nodepointer)malloc(sizeof(struct node)); myqueue->front = new; } int init(Queuepointer q){ q = (Queuepointer)malloc(sizeof(struct queue)); q->front = NULL; q->back = NULL; } The idea is that the queue struct 'contains' the first and last nodes in a queue, and when a node is created, myqueue is updated. However, I cannot even get to that part (pop and push are written but omitted for brevity). The code is segfaulting at the line myqueue->front = new; with the following gdb output: Program received signal SIGSEGV, Segmentation fault. 0x08048401 in main () at queue.c:27 27 myqueue->front = new; Any idea what I'm doing wrong?

    Read the article

  • Getting memory section information

    - by Basilevs
    Can somebody explain me how the following code works? # if defined(__ELF__) # define __SECTION_FLAGS ", \"aw\" , @progbits" /* writable flag needed for ld ".[cd]tors" sections bug workaround) */ # elif defined(__COFF__) # define __SECTION_FLAGS ", \"dr\"" /* untested, may be writable flag needed */ # endif asm ( ".section .ctors" __SECTION_FLAGS "\n" ".globl __ctors_begin__\n" "__ctors_begin__:\n" ".previous\n" ); asm /* ld ".[cd]tors" sections bug workaround */ ( ".section .ctors0" __SECTION_FLAGS "\n" ".globl __ctors0_begin__\n" "__ctors0_begin__:\n" ".previous\n" ); Similarly we are getting __ctors_end__ , __ctors0_end__ and destructors location is also obtained this way. After some ld bug workarounds all functions pointed by pointers from __ctors_begin__ to __ctors_end__ are executed. I don't know assembler and this code is impossible for me to interpret. BTW: I know that invoking C++ contructors/destructors from C is not a task to be considered safe or easy.

    Read the article

  • Castle Interceptor Live Cycle and Memory Leak

    - by ktutnik
    Hello all, im new to castle dynamic proxy, and a bit curious.. when creating proxy of my object i save all the original value of its property on the interceptor (class scope) using dictionary and return the new value. now i wandering, when will this data get collected by GC?? can i control it or depends on the interceptor live cycle? Regards Kin

    Read the article

  • WPF In-Memory Image Display

    - by Aren B
    Im trying to build an Item Template for my list-view and im bound to a list of Entities. The entity I have has a System.Drawing.Image that I'd like to display, but so far I cannot for the life of me figure out how to bind it to the <Image> block. Every example and documentation I can find on the internet pertains to Images accessible via an uri i.e. File on HDD or On Website <DataTemplate x:Key="LogoPreviewItem"> <Border BorderBrush="Black" BorderThickness="1"> <DockPanel Width="150" Height="100"> <Image> <Image.Source> <!-- {Binding PreviewImage} is where the System.Drawing.Image is in this context --> </Image.Source> </Image> <Label DockPanel.Dock="Bottom" Content="{Binding CustomerName}" /> </DockPanel> </Border> </DataTemplate>

    Read the article

  • AppDelegate viewController memory leak?

    - by fuzzygoat
    I am just curious with regards to the correct way to create a view controller programatically. When I compile this code with the static analyser I get a leak (as you would expect) from the alloc. Should I just leave it as it needs to stay until the app exits anyways, or is there a cleaner way? - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { NSLog(@"UIApplication application:"); RectViewController *myController = [[RectViewController alloc] init]; [window addSubview:[myController view]]; [window makeKeyAndVisible]; return YES; } cheers Gary

    Read the article

  • exchanging 2 memory positions

    - by Jordi
    I am working with OpenCV and Qt, Opencv use BGR while Qt uses RGB , so I have to swap those 2 bytes for very big images. There is a better way of doing the following? I can not think of anything faster but looks so simple and lame... int width = iplImage->width; int height = iplImage->height; uchar *iplImagePtr = (uchar *) iplImage->imageData; uchar buf; int limit = height * width; for (int y = 0; y < limit; ++y) { buf = iplImagePtr[2]; iplImagePtr[2] = iplImagePtr[0]; iplImagePtr[0] = buf; iplImagePtr += 3; } QImage img((uchar *) iplImage->imageData, width, height, QImage::Format_RGB888);

    Read the article

  • Sening a file from memory (rather than disk) over HTTP using libcurl

    - by cinek1lol
    Hi! I would like to send pictures via a program written in C + +. - OK WinExec("C:\\curl\\curl.exe -H Expect: -F \"fileupload=@C:\\curl\\ok.jpg\" -F \"xml=yes\" -# \"http://www.imageshack.us/index.php\" -o data.txt -A \"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1\" -e \"http://www.imageshack.us\"", NULL); It works, but I would like to send the pictures from pre-loaded carrier to a variable char (you know what I mean? First off, I load the pictures into a variable and then send the variable), cause now I have to specify the path of the picture on a disk. I wanted to write this program in c++ by using the curl library, not through exe. extension. I have also found such a program (which has been modified by me a bit) #include <stdio.h> #include <string.h> #include <iostream> #include <curl/curl.h> #include <curl/types.h> #include <curl/easy.h> int main(int argc, char *argv[]) { CURL *curl; CURLcode res; struct curl_httppost *formpost=NULL; struct curl_httppost *lastptr=NULL; struct curl_slist *headerlist=NULL; static const char buf[] = "Expect:"; curl_global_init(CURL_GLOBAL_ALL); /* Fill in the file upload field */ curl_formadd(&formpost, &lastptr, CURLFORM_COPYNAME, "send", CURLFORM_FILE, "nowy.jpg", CURLFORM_END); curl_formadd(&formpost, &lastptr, CURLFORM_COPYNAME, "nowy.jpg", CURLFORM_COPYCONTENTS, "nowy.jpg", CURLFORM_END); curl_formadd(&formpost, &lastptr, CURLFORM_COPYNAME, "submit", CURLFORM_COPYCONTENTS, "send", CURLFORM_END); curl = curl_easy_init(); headerlist = curl_slist_append(headerlist, buf); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "http://www.imageshack.us/index.php"); if ( (argc == 2) && (!strcmp(argv[1], "xml=yes")) ) curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerlist); curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost); res = curl_easy_perform(curl); curl_easy_cleanup(curl); curl_formfree(formpost); curl_slist_free_all (headerlist); } system("pause"); return 0; }

    Read the article

  • Memory problem with basic UITableView when scrolling

    - by Sheehan Alam
    I have a very simple UITableView that has 3 sections, and 3 rows per section. #pragma mark - #pragma mark UITableView delegate methods - (NSInteger)tableView:(UITableView *)tblView numberOfRowsInSection:(NSInteger)section { return 3; } - (UITableViewCell *)tableView:(UITableView *)tblView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tblView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; } // Configure the cell... return cell; } - (NSInteger)numberOfSectionsInTableView:(UITableView *)tblView { if (tblView == self.tableView) { return 3; } else { return 1; } } Everything shows up fine, but as soon as I scroll my application crashes and my debugger tells me: * -[ProfileViewController tableView:cellForRowAtIndexPath:]: message sent to deallocated instance 0x5ae61b0 I'm not exactly sure what I am doing wrong.

    Read the article

< Previous Page | 125 126 127 128 129 130 131 132 133 134 135 136  | Next Page >