Search Results

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

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

  • Out of memory error

    - by Rahul Varma
    Hi, I am trying to retrieve a list of images and text from a web service. I have first coded to get the images to a list using Simple Adapter. The images are getting displayed the app is showing an error and in the Logcat the following errors occur... 04-26 10:55:39.483: ERROR/dalvikvm-heap(1047): 8850-byte external allocation too large for this process. 04-26 10:55:39.493: ERROR/(1047): VM won't let us allocate 8850 bytes 04-26 10:55:39.563: ERROR/AndroidRuntime(1047): Uncaught handler: thread Thread-96 exiting due to uncaught exception 04-26 10:55:39.573: ERROR/AndroidRuntime(1047): java.lang.OutOfMemoryError: bitmap size exceeds VM budget 04-26 10:55:39.573: ERROR/AndroidRuntime(1047): at android.graphics.BitmapFactory.nativeDecodeStream(Native Method) 04-26 10:55:39.573: ERROR/AndroidRuntime(1047): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:451) 04-26 10:55:39.573: ERROR/AndroidRuntime(1047): at com.stellent.gorinka.AsyncImageLoaderv.loadImageFromUrl(AsyncImageLoaderv.java:57) 04-26 10:55:39.573: ERROR/AndroidRuntime(1047): at com.stellent.gorinka.AsyncImageLoaderv$2.run(AsyncImageLoaderv.java:41) 04-26 10:55:40.393: ERROR/dalvikvm-heap(1047): 14600-byte external allocation too large for this process. 04-26 10:55:40.403: ERROR/(1047): VM won't let us allocate 14600 bytes 04-26 10:55:40.493: ERROR/AndroidRuntime(1047): Uncaught handler: thread Thread-93 exiting due to uncaught exception 04-26 10:55:40.493: ERROR/AndroidRuntime(1047): java.lang.OutOfMemoryError: bitmap size exceeds VM budget 04-26 10:55:40.493: ERROR/AndroidRuntime(1047): at android.graphics.BitmapFactory.nativeDecodeStream(Native Method) 04-26 10:55:40.493: ERROR/AndroidRuntime(1047): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:451) 04-26 10:55:40.493: ERROR/AndroidRuntime(1047): at com.stellent.gorinka.AsyncImageLoaderv.loadImageFromUrl(AsyncImageLoaderv.java:57) 04-26 10:55:40.493: ERROR/AndroidRuntime(1047): at com.stellent.gorinka.AsyncImageLoaderv$2.run(AsyncImageLoaderv.java:41) 04-26 10:55:40.594: INFO/Process(584): Sending signal. PID: 1047 SIG: 3 Here's the coding in the adapter... final ImageView imageView = (ImageView) rowView.findViewById(R.id.image); AsyncImageLoaderv asyncImageLoader=new AsyncImageLoaderv(); Bitmap cachedImage = asyncImageLoader.loadDrawable(imgPath, new AsyncImageLoaderv.ImageCallback() { public void imageLoaded(Bitmap imageDrawable, String imageUrl) { imageView.setImageBitmap(imageDrawable); } }); imageView.setImageBitmap(cachedImage); .......... ........... ............ //To load the image... public static Bitmap loadImageFromUrl(String url) { InputStream inputStream;Bitmap b; try { inputStream = (InputStream) new URL(url).getContent(); BitmapFactory.Options bpo= new BitmapFactory.Options(); bpo.inSampleSize=2; b=BitmapFactory.decodeStream(inputStream, null,bpo ); return b; } catch (IOException e) { throw new RuntimeException(e); } // return null; } Please tell me how to fix the error....

    Read the article

  • Get specific process memory space

    - by Saul Rennison
    Hi, I have a pointer (void *) to a function and I want to know which process this function belongs to. I have no idea which way to go about it, but I think it's possible by using some form of VirtualQuery trickery. Any help would be appreciated. Thanks in advance,

    Read the article

  • Internet and Intellisense bad for your memory?

    - by Barry Jones
    Having programmed for a while now I have noticed that I am becoming more and more reliant on the internet and intellisense to do my job. But I was wondering how much that has effected my knowledge over the past year or so. But does this matter? For example I am more likely now to remember that when I need to program against objects I have no knowledge about, I will go to the System.Reflection namespace and a quick look down the list will provide me with enough detail to get going again. But if you was to ask me which classes etc are required I would struggle to name them all. This problem of remembering seems to manifest itself more when going for interviews when people seem to focus more on the minute detail of obscure areas of the .NET framework and not on the wide and varied knowledge and experience of the applicant. Anyway I digress. Does anyone else think that maybe its time to turn of the intellisense and try and find better ways to learn, then quick fixes and work arounds of the internet?

    Read the article

  • how do i scroll through 100 photos in UIScrollView in IPhone

    - by mwangima
    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 with this error: [CALayer retain]: message sent to deallocated instance what could be the problem below is my code sample - (void)scrollViewDidEndDecelerating:(UIScrollView *)_scrollView { pageControlIsChangingPage = NO; CGFloat pageWidth = _scrollView.frame.size.width; int page = floor((_scrollView.contentOffset.x - pageWidth / 2) / pageWidth) + 1; if (page1 && page<=(pageControl.numberOfPages-3)) { [self removeThisView:(page-2)]; [self removeThisView:(page+2)]; } if(page0) { NSLog(@"<< PREVIOUS"); [self showPhoto:(page-1)]; } [self showPhoto:page]; if(page<(pageControl.numberOfPages-1)) { //NSLog(@"NEXT "); [self showPhoto:page+1]; NSLog(@"FINISHED LOADING NEXT "); } } -(void) showPhoto:(NSInteger)index { CGFloat cx = scrollView.frame.size.width*index; CGFloat cy = 40; CGRect rect=CGRectMake( 0, 0,320, 480); rect.origin.x = cx; rect.origin.y = cy; AsyncImageView* asyncImage = [[AsyncImageView alloc] initWithFrame:rect]; asyncImage.tag = 999; NSURL *url = [NSURL URLWithString:[pics objectAtIndex:index]]; [asyncImage loadImageFromURL:url place:CGRectMake(150, 190, 30, 30) member:memberid isSlide:@"Yes" picId:[picsIds objectAtIndex:index]]; [scrollView addSubview:asyncImage]; [asyncImage release]; } -(void) removeThisView:(NSInteger)index { if(index<[[scrollView subviews] count] && [[scrollView subviews] objectAtIndex:index]!=nil){ if ([[[scrollView subviews] objectAtIndex:index] isKindOfClass:[AsyncImageView class]] || [[[scrollView subviews] objectAtIndex:index] isKindOfClass:[UIImageView class]]) { [[[scrollView subviews] objectAtIndex:index] removeFromSuperview]; } } } For the record it works OK in the simulator, but not the iphone device itself. any ideas will be appreciated. cheers, fred.

    Read the article

  • Error: Out of memory in function main

    - by RED
    I get this error whenever I put more of my gotoxy and textcolor but when putting more printf this error does not appear...well this was not appearing before, it just appeared in lately after tons of codes are inputted. -thanks....appreciation for those who can help or even read my question...thanks again.

    Read the article

  • How to increase PermGen memory for eclipselink StaticWeaveAntTask

    - by rayd09
    We are using Eclipselink and need to weave the code in order for lazy fetching to work property. During the weave process I'm getting the following error: weave: BUILD FAILED java.lang.OutOfMemoryError: PermGen space I have the following tasks within my ant build file: <target name="define_weave_task" description="task definition for EclipseLink static weaving"> <taskdef name="eclipse_weave" classname="org.eclipse.persistence.tools.weaving.jpa.StaticWeaveAntTask"/> </target> <target name="weave" depends="compile,define_weave_task" description="weave eclipselink code into compiled classes"> <eclipse_weave source="${path.classes}" target="${path.classes}"> <classpath refid="compile.classpath"/> </eclipse_weave> </target> It has been working great for a long time. Now that the amount of code to be woven has increased I'm getting the PermGen error. I would like to be able to up the amount of perm space. If I was doing a compile I would be able to up the perm space via a compiler argument such as <compilerarg value="-XX:MaxPermSize=256M"/> but this does not appear to be a valid argument for eclipselink weaving. How can I up the perm space for the weave?

    Read the article

  • Which memory related Tomcat JVM startup parameters are worth tuning?

    - by knorv
    I'm trying to understand the fine art of tuning Tomcat memory settings. In this quest I have the following three questions: Which memory related JVM startup parameters are worth setting when running Tomcat? Why? What are useful rule-of-thumbs when fine-tuning the memory settings for a Tomcat installation? How do you monitor the memory consumption of your live Tomcat installation?

    Read the article

  • Memory efficient collection class

    - by Joe
    I'm building an array of dictionaries (called keys) in my iphone application to hold the section names and row counts for a tableview. the code looks like this: [self.results removeAllObjects]; [self.keys removeAllObjects]; NSUInteger i,j = 0; NSString *key = [NSString string]; NSString *prevKey = [NSString string]; if ([self.allResults count] > 0) { prevKey = [NSString stringWithString:[[[self.allResults objectAtIndex:0] valueForKey:@"name"] substringToIndex:1]]; for (NSDictionary *theDict in self.allResults) { key = [NSString stringWithString:[[theDict valueForKey:@"name"] substringToIndex:1]]; if (![key isEqualToString:prevKey]) { NSDictionary *newDictionary = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:i],@"count", prevKey,@"section", [NSNumber numberWithInt:j], @"total",nil]; [self.keys addObject:newDictionary]; prevKey = [NSString stringWithString:key]; i = 1; } else { i++; } j++; } NSDictionary *newDictionary = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:i],@"count", prevKey,@"section", [NSNumber numberWithInt:j], @"total",nil]; [self.keys addObject:newDictionary]; } [self.tableview reloadData]; The code works fine first time through but I sometimes have to rebuild the entire table so I redo this code which orks fine on the simulator, but on my device the program bombs when I execute the reloadData line : malloc: *** mmap(size=3772944384) failed (error code=12) *** error: can't allocate region *** set a breakpoint in malloc_error_break to debug malloc: *** mmap(size=3772944384) failed (error code=12) *** error: can't allocate region *** set a breakpoint in malloc_error_break to debug Program received signal: “EXC_BAD_ACCESS”. If I remove the reloadData line the code works on the device. I'm wondering if this is something to do with the way I've built the keys array (ie using autoreleased strings and dictionaries).

    Read the article

  • Memcache vs MySQL in memory

    - by TimK
    I have a database that won't grow much in size. It's current size is about 1 GB. Achieving the fastest performance is desired. Question: When should I use Memcache vs simply using MySQL Innodb ability to store all my content within RAM (innodb_buffer_pool_size)?

    Read the article

  • NSThread and memory management

    - by misfit153
    Imagine I create and execute an NSThread object using detachNewThreadSelector:toTarget:withObject:. The method executed by the thread might look like this: - (void)search { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; // perform a lengthy search here. [pool release]; } I then might use the cancel method to kill the thread while it's running, before the pool gets released. What happens to the NSAutoreleasePool object? I suppose it will leak, won't it?

    Read the article

  • Remove never-run call to templated function, get allocation error on run-time

    - by Narfanator
    First off, I'm a bit at a loss as to how to ask this question. So I'm going to try throwing lots of information at the problem. Ok, so, I went to completely redesign my test project for my experimental core library thingy. I use a lot of template shenanigans in the library. When I removed the "user" code, the tests gave me a memory allocation error. After quite a bit of experimenting, I narrowed it down to this bit of code (out of a couple hundred lines): void VOODOO(components::switchBoard &board){ board.addComponent<using_allegro::keyInputs<'w'> >(); } Fundementally, what's weirding me out is that it appears that the act of compiling this function (and the template function it then uses, and the template functions those then use...), makes this bug not appear. This code is not being run. Similar code (the same, but for different key vals) occurs elsewhere, but is within Boost TDD code. I realize I certainly haven't given enough information for you to solve it for me; I tried, but it more-or-less spirals into most of the code base. I think I'm most looking for "here's what the problem could be", "here's where to look", etc. There's something that's happening during compile because of this line, but I don't know enough about that step to begin looking. Sooo, how can a (presumably) compilied, but never actually run, bit of templated code, when removed, cause another part of code to fail? Error: Unhandled exceptionat 0x6fe731ea (msvcr90d.dll) in Switchboard.exe: 0xC0000005: Access violation reading location 0xcdcdcdc1. Callstack: operator delete(void * pUser Data) allocator< class name related to key inputs callbacks ::deallocate vector< same class ::_Insert_n(...) vector< " " ::insert(...) vector<" "::push_back(...) It looks like maybe the vector isn't valid, because _MyFirst and similar data members are showing values of 0xcdcdcdcd in the debugger. But the vector is a member variable...

    Read the article

  • C++: Trouble with Pointers, loop variables, and structs

    - by Rosarch
    Consider the following example: #include <iostream> #include <sstream> #include <vector> #include <wchar.h> #include <stdlib.h> using namespace std; struct odp { int f; wchar_t* pstr; }; int main() { vector<odp> vec; ostringstream ss; wchar_t base[5]; wcscpy_s(base, L"1234"); for (int i = 0; i < 4; i++) { odp foo; foo.f = i; wchar_t loopStr[1]; foo.pstr = loopStr; // wchar_t* = wchar_t ? Why does this work? foo.pstr[0] = base[i]; vec.push_back(foo); } for (vector<odp>::iterator iter = vec.begin(); iter != vec.end(); iter++) { cout << "Vec contains: " << iter->f << ", " << *(iter->pstr) << endl; } } This produces: Vec contains: 0, 52 Vec contains: 1, 52 Vec contains: 2, 52 Vec contains: 3, 52 I would hope that each time, iter->f and iter->pstr would yield a different result. Unfortunately, iter->pstr is always the same. My suspicion is that each time through the loop, a new loopStr is created. Instead of copying it into the struct, I'm only copying a pointer. The location that the pointer writes to is getting overwritten. How can I avoid this? Is it possible to solve this problem without allocating memory on the heap?

    Read the article

  • Examining C/C++ Heap memory statistics in gdb

    - by fd
    I'm trying to investigate the state of the C/C++ heap from within gdb on Linux amd64, is there a nice way to do this? One approach I've tried is to "call mallinfo()" but unfortunately I can't then extract the values I want since gdb deal with the return value properly. I'm not easily able to write a function to be compiled into the binary for the process I am attached to, so I can simply implement my own function to extract the values by calling mallinfo() in my own code this way. Is there perhaps a clever trick that will allow me to do this on-the-fly? Another option could be to locate the heap and traverse the malloc headers / free list; I'd appreciate any pointers to where I could start in finding the location and layout of these. I've been trying to Google and read around the problem for about 2 hours and I've learnt some fascinating stuff but still not found what I need.

    Read the article

  • NSMutableArray memory management

    - by chicken
    NSMutableArray *a1 = [[NSMutableArray alloc] init]; NSMutableArray *a2 = [NSMutableArray array]; TempObj *obj = [[TempObj alloc] init]; //assume this line is repeated for each obj [a1 addObject:obj]; [a1 addObject:obj2]; [a1 addObject:obj3]; [a1 addObject:obj4]; [obj release]; [obj2 release]; [obj3 release]; [obj4 release]; [a1 release]; Ok so a2 is an autorelease obj so i dont have to call release on it? Also how do you know when you get an autorelease object? And for a1, i dont have to loop through the array and release each object first? What if i called [a1 removeAllObjects]; does that call [[a1 objectAtIndex:#] release]; Am i supposed to release those objects after ive added them to the array?

    Read the article

  • MPMediaickerController memory leak identified by Leaks instrument

    - by Joe
    This is code from Apple's Addmusic example. MPMediaPickerController *picker = [[MPMediaPickerController alloc] initWithMediaTypes: MPMediaTypeMusic]; picker.delegate = self; picker.allowsPickingMultipleItems = YES; picker.prompt = NSLocalizedString (@"Add songs to play", "Prompt in media item picker"); // The media item picker uses the default UI style, so it needs a default-style // status bar to match it visually [[UIApplication sharedApplication] setStatusBarStyle: UIStatusBarStyleDefault animated: YES]; [self presentModalViewController: picker animated: YES]; [picker release]; I'm using this code in my app and the Leaks instrument highlights a leak on the line: [self presentModalViewController: picker animated: YES]; I think that this is because this line retains a reference to picker which cannot be subsequently released. Is there any way around this or is Leaks incorrectly identifying a leak?

    Read the article

  • Slow DB Performance. Seems to be memory related.

    - by David
    I am seeing a pooorly performing web app with a SQL 2005 backend. The db is on a w2k3 machine with 4GB RAM. When I run perfmon on it I see the following. Page life expectancy is low. Consistently under 300 while the Buffer cache hit ratio is always 99% +. The target server memory is always 1618304 and the total server memory is always a number just below that. So it seems that it isn't grabbing enough of the available memory. I have AWE enabled, with the lock pages right for the SQL service account and have set a maximum of 2.25Gb... but it doesn't go near that. When I restart the SQL service the page life expectancy goes much higher, 1000+, and the total target memory starts at 0 and slowly works its way back up to the previous limit. Then it hits the limit and the page life expectancy goes back down massively to <300. So I'm guessing there is something limiting the amount of memory. Any ideas on what that would be and how I can fix it?

    Read the article

  • [Python] Tips for making a fraction calculator code more optimized (faster and using less memory)

    - by Logic Named Joe
    Hello Everyone, Basicly, what I need for the program to do is to act a as simple fraction calculator (for addition, subtraction, multiplication and division) for the a single line of input, for example: -input: 1/7 + 3/5 -output: 26/35 My initial code: import sys def euclid(numA, numB): while numB != 0: numRem = numA % numB numA = numB numB = numRem return numA for wejscie in sys.stdin: wyjscie = wejscie.split(' ') a, b = [int(x) for x in wyjscie[0].split("/")] c, d = [int(x) for x in wyjscie[2].split("/")] if wyjscie[1] == '+': licz = a * d + b * c mian= b * d nwd = euclid(licz, mian) konA = licz/nwd konB = mian/nwd wynik = str(konA) + '/' + str(konB) print(wynik) elif wyjscie[1] == '-': licz= a * d - b * c mian= b * d nwd = euclid(licz, mian) konA = licz/nwd konB = mian/nwd wynik = str(konA) + '/' + str(konB) print(wynik) elif wyjscie[1] == '*': licz= a * c mian= b * d nwd = euclid(licz, mian) konA = licz/nwd konB = mian/nwd wynik = str(konA) + '/' + str(konB) print(wynik) else: licz= a * d mian= b * c nwd = euclid(licz, mian) konA = licz/nwd konB = mian/nwd wynik = str(konA) + '/' + str(konB) print(wynik) Which I reduced to: import sys def euclid(numA, numB): while numB != 0: numRem = numA % numB numA = numB numB = numRem return numA for wejscie in sys.stdin: wyjscie = wejscie.split(' ') a, b = [int(x) for x in wyjscie[0].split("/")] c, d = [int(x) for x in wyjscie[2].split("/")] if wyjscie[1] == '+': print("/".join([str((a * d + b * c)/euclid(a * d + b * c, b * d)),str((b * d)/euclid(a * d + b * c, b * d))])) elif wyjscie[1] == '-': print("/".join([str((a * d - b * c)/euclid(a * d - b * c, b * d)),str((b * d)/euclid(a * d - b * c, b * d))])) elif wyjscie[1] == '*': print("/".join([str((a * c)/euclid(a * c, b * d)),str((b * d)/euclid(a * c, b * d))])) else: print("/".join([str((a * d)/euclid(a * d, b * c)),str((b * c)/euclid(a * d, b * c))])) Any advice on how to improve this futher is welcome. Edit: one more thing that I forgot to mention - the code can not make use of any libraries apart from sys.

    Read the article

  • Cant free memory.

    - by atch
    In code: int a[3][4] = {1,2,3,4, 5,6,7,8, 9,10,11,12}; template<class T, int row, int col> void invert(T a[row][col]) { T* columns = new T[col]; T* const free_me = columns; for (int i = 0; i < col; ++i) { for (int j = 0; j < row; ++j) { *columns = a[j][i]; ++columns;//SOMETIMES VALUE IS 0 } } delete[] free_me;//I'M GETTING ERROR OF HEAP ABUSE IN THIS LINE } int main(int argc, char* argv[]) { invert<int,3,4>(a); } I've observed that while iterating, value of variable columns equals zero and I think thats the problem. Thanks for your help.

    Read the article

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