Search Results

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

Page 112/491 | < Previous Page | 108 109 110 111 112 113 114 115 116 117 118 119  | Next Page >

  • Lambdas within Extension methods: Possible memory leak?

    - by Oliver
    I just gave an answer to a quite simple question by using an extension method. But after writing it down i remembered that you can't unsubscribe a lambda from an event handler. So far no big problem. But how does all this behave within an extension method?? Below is my code snipped again. So can anyone enlighten me, if this will lead to myriads of timers hanging around in memory if you call this extension method multiple times? I would say no, cause the scope of the timer is limited within this function. So after leaving it no one else has a reference to this object. I'm just a little unsure, cause we're here within a static function in a static class. public static class LabelExtensions { public static Label BlinkText(this Label label, int duration) { Timer timer = new Timer(); timer.Interval = duration; timer.Tick += (sender, e) => { timer.Stop(); label.Font = new Font(label.Font, label.Font.Style ^ FontStyle.Bold); }; label.Font = new Font(label.Font, label.Font.Style | FontStyle.Bold); timer.Start(); return label; } }

    Read the article

  • Loading a RSA private key from memory using libxmlsec

    - by ereOn
    Hello, I'm currently using libxmlsec into my C++ software and I try to load a RSA private key from memory. To do this, I searched trough the API and found this function. It takes binary data, a size, a format string and several PEM-callback related parameters. When I call the function, it just stucks, uses 100% of the CPU time and never returns. Quite annoying, because I have no way of finding out what is wrong. Here is my code: d_xmlsec_dsig_context->signKey = xmlSecCryptoAppKeyLoadMemory( reinterpret_cast<const xmlSecByte*>(data), static_cast<xmlSecSize>(datalen), xmlSecKeyDataFormatBinary, NULL, NULL, NULL ); data is a const char* pointing to the raw bytes of my RSA key (using i2d_RSAPrivateKey(), from OpenSSL) and datalen the size of data. My test private key doesn't have a passphrase so I decided not to use the callbacks for the time being. Has someone already done something similar ? Do you guys see anything that I could change/test to get forward on this problem ? I just discovered the library on yesterday, so I might miss something obvious here; I just can't see it. Thank you very much for your help.

    Read the article

  • JVM segmentation faults due to "Invalid memory access of location"

    - by Dan
    I have a small project written in Scala 2.9.2 with unit tests written using ScalaTest. I use SBT for compiling and running my tests. Running sbt test on my project makes the JVM segfault regularly, but just compiling and running my project from SBT works fine. Here is the exact error message: Invalid memory access of location 0x8 rip=0x10959f3c9 [1] 11925 segmentation fault sbt I cannot locate a core dump anywhere, but would be happy to provide it if it can be obtained. Running java -version results in this: java version "1.6.0_37" Java(TM) SE Runtime Environment (build 1.6.0_37-b06-434-11M3909) Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01-434, mixed mode) But I've also got Java 7 installed (though I was never able to actually run a Java program with it, afaik). Another issue that may be related: some of my test cases contain titles including parentheses like ( and ). SBT or ScalaTest (not sure) will consequently insert square parens in the middle of the output. For example, a test case with the name (..)..(..) might suddenly look like (..[)..](..). Any help resolving these issues is much appreciated :-) EDIT: I installed the Java 7 JDK, so now java -version shows the right thing: java version "1.7.0_07" Java(TM) SE Runtime Environment (build 1.7.0_07-b10) Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode) This also means that I now get a more detailed segfault error and a core dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x000000010a71a3e3, pid=16830, tid=19459 # # JRE version: 7.0_07-b10 # Java VM: Java HotSpot(TM) 64-Bit Server VM (23.3-b01 mixed mode bsd-amd64 compressed oops) # Problematic frame: # V [libjvm.dylib+0x3cd3e3] And the dump.

    Read the article

  • AS3 Memory Conservation (Loaders/BitmapDatas/Bitmaps/Sprites)

    - by rinogo
    I'm working on reducing the memory requirements of my AS3 app. I understand that once there are no remaining references to an object, it is flagged as being a candidate for garbage collection. Is it even worth it to try to remove references to Loaders that are no longer actively in use? My first thought is that it is not worth it. Here's why: My Sprites need perpetual references to the Bitmaps they display (since the Sprites are always visible in my app). So, the Bitmaps cannot be garbage collected. The Bitmaps rely upon BitmapData objects for their data, so we can't get rid of them. (Up until this point it's all pretty straightforward). Here's where I'm unsure of what's going on: Does a BitmapData have a reference to the data loaded by the Loader? In other words, is BitmapData essentially just a wrapper that has a reference to loader.content, or is the data copied from loader.content to BitmapData? If a reference is maintained, then I don't get anything by garbage collecting my loaders... Thoughts?

    Read the article

  • Why I got some memory problems?

    - by Tattat
    I got this error from XCode: objc[8422]: FREED(id): message release sent to freed object=0x3b120c0 I googled and find that is related to the memory. But I don't know which line of code I go wrong, any ideas? @implementation MyAppDelegate @synthesize window; @synthesize viewController; - (void)applicationDidFinishLaunching:(UIApplication *)application { // Override point for customization after app launch [window addSubview:viewController.view]; [window makeKeyAndVisible]; [self changeScene:[MainGameMenuScene class]]; } - (void)dealloc { [viewController release]; [window release]; [super dealloc]; } - (void) changeScene: (Class) scene { BOOL animateTransition = true; if(animateTransition){ [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:0.5]; [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:window cache:YES]; //does nothing without this line. } if( viewController.view != nil ) { [viewController.view removeFromSuperview]; //remove view from window's subviews. [viewController.view release]; //release gamestate } viewController.view = [[scene alloc] initWithFrame:CGRectMake(0, 0, IPHONE_WIDTH, IPHONE_HEIGHT) andManager:self]; //now set our view as visible [window addSubview:viewController.view]; [window makeKeyAndVisible]; if(animateTransition){ [UIView commitAnimations]; } }

    Read the article

  • Help to resolve 'Out of memory' exception when calling DrawImage

    - by Jack Juiceson
    Hi guys, About one percent of our users experience sudden crash while using our application. The logs show below exception, the only thing in common that I've seen so far is that, they all have XP SP3. Thanks in advance Out of memory. at System.Drawing.Graphics.CheckErrorStatus(Int32 status) at System.Drawing.Graphics.DrawImage(Image image, Rectangle destRect, Int32 srcX, Int32 srcY, Int32 srcWidth, Int32 srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs, DrawImageAbort callback, IntPtr callbackData) at System.Drawing.Graphics.DrawImage(Image image, Rectangle destRect, Int32 srcX, Int32 srcY, Int32 srcWidth, Int32 srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback) at System.Drawing.Graphics.DrawImage(Image image, Rectangle destRect, Int32 srcX, Int32 srcY, Int32 srcWidth, Int32 srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr) at System.Windows.Forms.ControlPaint.DrawBackgroundImage(Graphics g, Image backgroundImage, Color backColor, ImageLayout backgroundImageLayout, Rectangle bounds, Rectangle clipRect, Point scrollOffset, RightToLeft rightToLeft) at System.Windows.Forms.Control.PaintBackground(PaintEventArgs e, Rectangle rectangle, Color backColor, Point scrollOffset) at System.Windows.Forms.Control.PaintBackground(PaintEventArgs e, Rectangle rectangle) at System.Windows.Forms.Control.OnPaintBackground(PaintEventArgs pevent) at System.Windows.Forms.ScrollableControl.OnPaintBackground(PaintEventArgs e) at System.Windows.Forms.Control.PaintTransparentBackground(PaintEventArgs e, Rectangle rectangle, Region transparentRegion) at System.Windows.Forms.Control.PaintBackground(PaintEventArgs e, Rectangle rectangle, Color backColor, Point scrollOffset) at System.Windows.Forms.Control.PaintBackground(PaintEventArgs e, Rectangle rectangle) at System.Windows.Forms.Control.OnPaintBackground(PaintEventArgs pevent) at System.Windows.Forms.ScrollableControl.OnPaintBackground(PaintEventArgs e) at System.Windows.Forms.Control.PaintTransparentBackground(PaintEventArgs e, Rectangle rectangle, Region transparentRegion) at System.Windows.Forms.Control.PaintBackground(PaintEventArgs e, Rectangle rectangle, Color backColor, Point scrollOffset) at System.Windows.Forms.Control.PaintBackground(PaintEventArgs e, Rectangle rectangle) at System.Windows.Forms.Control.OnPaintBackground(PaintEventArgs pevent) at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs) at System.Windows.Forms.Control.WmPaint(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) Operation System Information ---------------------------- Name = Windows XP Edition = Home Service Pack = Service Pack 3 Version = 5.1.2600.196608 Bits = 32

    Read the article

  • Android maps out of memory error

    - by SamB09
    Hi , sometimes when running a google maps program with an overlay image i will receive a bit map out of memory error. It always seems to be at a random point in the app. Im not sure how to solve this. Anyone have any ideas ? My overlay code is below , im not sure if you need to see the class its called in though? public class MyOverlay2 extends Overlay { private static final double MAX_TAP_DISTANCE_KM = 3; // Rough approximation - one degree = 50 nautical miles private static final double MAX_TAP_DISTANCE_DEGREES = MAX_TAP_DISTANCE_KM * 0.5399568 * 50; private final GeoPoint gPoint; private final Context cont; private final int draw; // private final int lat; public MyOverlay2(Context cont, GeoPoint gPoint1, int draw) { // constructor will be called in the userLocation class to draw an overly image this.cont = cont; this.gPoint = gPoint1; this.draw = draw; } @Override public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when) { // constructor takes 3 arguments super.draw(canvas, mapView, shadow); // Convert geo coordinates to screen pixels Point screenPoint = new Point(); mapView.getProjection().toPixels(gPoint, screenPoint); //Read the image from the xml resource using a bitmap factory BitmapFactory.Options options=new BitmapFactory.Options(); options.inSampleSize = 1; Bitmap preview_bitmap=BitmapFactory.decodeResource(cont.getResources(),R.drawable.monday12,options); //draw the image at the location specified by the co-ordinates canvas.drawBitmap(preview_bitmap, screenPoint.x - preview_bitmap.getWidth() /2, screenPoint.y - preview_bitmap.getHeight()/2 , null); // get the images height and width values divided by two draw the image at the specified screen points return true; } @Override public boolean onTap(GeoPoint s, MapView mapView) { // Handle tapping on the overlay here return true; } }

    Read the article

  • Comet, responseText and memory usage

    - by ithcy
    Is there a way to clear out the responseText of an XHR object without destroying the XHR object? I need to keep a persistent connection open to a web server to feed live data to a browser. The problem is, there is a relatively large amount of data coming through (several hundred K per second constantly), so memory usage is a big problem, because this connection must remain open for at least several minutes. responseText gets very big very quickly, even though the JSON I send back has been crunched as small as it can get. Due to the way the server-side app works, if I use AJAX-style short polling and just destroy the XHR object when I'm done with it, I miss significant amounts of important data even in the few milliseconds it takes to parse the response, create a new XHR and send it out. I do not have the option to use overlapping requests, as the web server only accepts one connection at a time. (Don't ask.) So Comet is exactly the model I need. What I would like to do is parse each JSON chunk as it comes back from the server, and then clear out responseText so that I can keep using the same connection. However, responseText is read-only. It cannot be directly emptied by any method I have found. Is there a part of the picture I am missing here? Does anyone know any tricks I can use to free up responseText when I'm done reading it? Or is there another place the server responses can go? I am not including code because this is really almost a code-agnostic question. The Javascript routines that spawn the XHRs and handle the returned data are very, very simple.

    Read the article

  • read text file from phone memory in android

    - by Sudhakar
    Hi..I just wanna create a text file into phone memory and have to read its content to display.Now i created a text file.But its not present in the path data/data/package-name/file name.txt & it didn't display the content on emulator. My code is.. public class PhonememAct extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); TextView tv=(TextView)findViewById(R.id.tv); FileOutputStream fos = null; try { fos = openFileOutput("Test.txt", Context.MODE_PRIVATE); } catch (FileNotFoundException e2) { // TODO Auto-generated catch block e2.printStackTrace(); } try { fos.write("Hai..".getBytes()); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } try { fos.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } FileInputStream fis = null; try { fis = openFileInput("Test.txt"); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } int c; try { while((c=fis.read())!=-1) { tv.setText(c); setContentView(tv); //k += (char)c; } } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } try { fis.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } Thanks in adv.

    Read the article

  • C & MinGW: Hello World gives me the error "programm too big to fit in memory"

    - by user1692088
    I'm new here. Here's my problem: I installed MinGW on my Windows 7 Home Premium 32-bit Netbook with Intel Atom CPU N550, 1.50GHz and 2GB RAM. Now I made a file named hello.h and tried to compile it via CMD with the following command: "gcc c:\workspace\c\helloworld\hello.h -o out.exe" It compiles with no error, but when I try to run out.exe, it gives me following error: "program too big to fit in memory" Things I have checked: I have added "C:\MinGW\bin" to the Windows PATH Variable I have googled for about one hour, but ever since I'm a newbie, I can't really figure out what the problem is. I have compiled the same code on my 64-bit machine, compiles perfectly, but cannot be run due to 64-bit <- 16-bit problematic. I'd really appreciate, if someone could figure out, what the problem is. Btw, here's my hello.h: #include <stdio.h> int main(void){ printf("Hello, World\n"); } ... That's it. Thanks for your replies. Cheers, Boris

    Read the article

  • Memory leak in Apples 'Scrolling' sample code

    - by John
    Hi All, I'm using code based on Apple's "Scrolling" sample code - here's where I have a problem: // load all the images from our bundle and add them to the scroll view NSUInteger i; for (i = 1; i <= jNumImages; i++) { NSString *imageName = [NSString stringWithFormat:@"page%d.png", i]; UIImage *image = [UIImage imageNamed:imageName]; UIImageView *imageView2 = [[UIImageView alloc] initWithImage:image]; The UIImageView causes a leak - it doesn't seem to be releasing (though I do state [imageView2 release]; after adding the imageView as a subView to scrollView2 I have say 15 chapters of a book each held in a nav bar, each containing a scroll view with one chapters worth of these image views (each image is a page). When I get to around the second last chapter the app crashes due to the memory leaks... really annoying! I think it might be because imageView's been alloc'd twice (in alloc and in addSubView) but i'm not sure.... tried releasing twice but it didn't seem to help. any pointers? Thanks in advance ^.^

    Read the article

  • Using a php://memory wrapper causes errors...

    - by HorusKol
    I'm trying to extend the PHP mailer class from Worx by adding a method which allows me to add attachments using string data rather than path to the file. I came up with something like this: public function addAttachmentString($string, $name='', $encoding = 'base64', $type = 'application/octet-stream') { $path = 'php://memory/' . md5(microtime()); $file = fopen($path, 'w'); fwrite($file, $string); fclose($file); $this->AddAttachment($path, $name, $encoding, $type); } However, all I get is a PHP warning: PHP Warning: fopen() [<a href='function.fopen'>function.fopen</a>]: Invalid php:// URL specified There aren't any decent examples with the original documentation, but I've found a couple around the internet (including one here on SO), and my usage appears correct according to them. Has anyone had any success with using this? My alternative is to create a temporary file and clean up - but that will mean having to write to disc, and this function will be used as part of a large batch process and I want to avoid slow disc operations (old server) where possible. This is only a short file but has different information for each person the script emails.

    Read the article

  • Google Spreadsheet API problem: memory exceeded

    - by Robbert
    Hi guys, Don't know if anyone has experience with the Google Spreadsheets API or the Zend_GData classes but it's worth a go: When I try to insert a value in a 750 row spreadsheet, it takes ages and then throws an error that my memory limit (which is 128 MB!) was exceeded. I also got this when querying all records of this spreadsheet but this I can imaging because it's quite a lot of data. But why does this happen when inserting a row? That's not too complex, is it? Here's the code I used: public function insertIntoSpreadsheet($username, $password, $spreadSheetId, $data = array()) { $service = Zend_Gdata_Spreadsheets::AUTH_SERVICE_NAME; $client = Zend_Gdata_ClientLogin::getHttpClient($username, $password, $service); $client->setConfig(array( 'timeout' => 240 )); $service = new Zend_Gdata_Spreadsheets($client); if (count($data) == 0) { die("No valid data"); } try { $newEntry = $service->insertRow($data, $spreadSheetId); return true; } catch (Exception $e) { return false; } }

    Read the article

  • FreeTDS runs out of memory from DBD::Sybase

    - by skiphoppy
    When I add client charset = UTF-8 to my freetds.conf file, my DBD::Sybase program emits: Out of memory! and terminates. This happens when I call execute() on an SQL query statement that returns any ntext fields. I can return numeric data, datetimes, and nvarchars just fine, but whenever one of the output fields is ntext, I get this error. All these queries work perfectly fine without the UTF-8 setting, but I do need to handle some characters that throw warnings under the default character set. (See related question.) The error message is not formatted the same way other DBD::Sybase error messages seem to be formatted. I do get a message that a rollback() is being issued, though. (My false AutoCommit flag is being honored.) I think I read somewhere that FreeTDS uses the iconv program to convert between character sets; is it possible that this message is being emitted from iconv? If I execute the same query with the same freetds.conf settings in tsql (FreeTDS's command-line SQL shell), I don't get the error. I'm connecting to SQL Server. What do I need to do to get these queries to return successfully?

    Read the article

  • Silverlight WinDg Memory Release Issue

    - by Chris Newton
    Hi, I have used WinDbg succesfully on a number of occasions to track down and fix memory leaks (or more accurately the CLRs inability to garbage collect a released object), but am stuck with one particular control. The control is displayed within a child window and when the window is closed a reference to the control remains and cannot be garbage collected. I have resolved what I believe to be the majority of the issues that could have caused the leak, but the !gcroot of the affected object is not clear (to me at least) as to what is still holding on to this object. The ouput is always the same regardless of the content being presented in the child window: DOMAIN(03FB7238):HANDLE(Pinned):79b12f8:Root: 06704260(System.Object[])- 05719f00(System.Collections.Generic.Dictionary2[[System.IntPtr, mscorlib],[System.Object, mscorlib]])-> 067c1310(System.Collections.Generic.Dictionary2+Entry[[System.IntPtr, mscorlib],[System.Object, mscorlib]][])- 064d42b0(System.Windows.Controls.Grid)- 064d4314(System.Collections.Generic.Dictionary2[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]])-> 064d4360(System.Collections.Generic.Dictionary2+Entry[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]][])- 064d3860(System.Windows.Controls.Border)- 064d4218(System.Collections.Generic.Dictionary2[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]])-> 064d4264(System.Collections.Generic.Dictionary2+Entry[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]][])- 064d3bfc(System.Windows.Controls.ContentPresenter)- 064d3d64(System.Collections.Generic.Dictionary2[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]])-> 064d3db0(System.Collections.Generic.Dictionary2+Entry[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]][])- 064d3dec(System.Collections.Generic.Dictionary2[[System.UInt32, mscorlib],[System.Windows.DependencyObject, System.Windows]])-> 064d3e38(System.Collections.Generic.Dictionary2+Entry[[System.UInt32, mscorlib],[System.Windows.DependencyObject, System.Windows]][])- 06490b04(Insurer.Analytics.SharedResources.Controls.HistoricalKPIViewerControl) If anyone has any ideas about what could potentially be the problem, or if you require more information, please let me know. Kind Regards, Chris

    Read the article

  • Thread-safety of read-only memory access

    - by Edmund
    I've implemented the Barnes-Hut gravity algorithm in C as follows: Build a tree of clustered stars. For each star, traverse the tree and apply the gravitational forces from each applicable node. Update the star velocities and positions. Stage 2 is the most expensive stage, and so is implemented in parallel by dividing the set of stars. E.g. with 1000 stars and 2 threads, I have one thread processing the first 500 stars and the second thread processing the second 500. In practice this works: it speeds the computation by about 30% with two threads on a two-core machine, compared to the non-threaded version. Additionally, it yields the same numerical results as the original non-threaded version. My concern is that the two threads are accessing the same resource (namely, the tree) simultaneously. I have not added any synchronisation to the thread workers, so it's likely they will attempt to read from the same location at some point. Although access to the tree is strictly read-only I am not 100% sure it's safe. It has worked when I've tested it but I know this is no guarantee of correctness! Questions Do I need to make a private copy of the tree for each thread? Even if it is safe, are there performance problems of accessing the same memory from multiple threads?

    Read the article

  • how do i implement / build / create an 'in memory database' for my unit test

    - by Michel
    Hi all, i've started unit testing a while ago and as turned out i did more regression testing than unit testing because i also included my database layer thus going to the database verytime. So, implemented Unity to inject a fake database layer, but i of course want to store some data, and the main opinion was: "create an in-memory database" But what is that / how do i implement that? Main question is: i think i have to fake the database layer, but doesn't that make me create a 'simple database' myself or: how can i keep it simple and not rebuilding Sql Server just for my unit tests :) At the end of this question i'll give an explanation of the situation i got in on the project i just started on, and i was wondering if this was the way to go. Michel Current situation i've seen at this client is that testdata is contained in XML files, and there is a 'fake' database layer that connects all the xml files together. For the real database we're using the entity framework, and this works very simple. And now, in the 'fake' layer, i have top create all kind of classes to load, save, persist etc. the data. It sounds weird that there is so much work in the fake layer, and so little in the real layer. I hope this all makes sense :)

    Read the article

  • strange memory error when deleting object from Core Data

    - by llloydxmas
    I have an application that downloads an xml file, parses the file, and creates core data objects while doing so. In the parse code I have a function called 'emptydatacontext' that removes all items from Core Data before creating replacements from the xml file. This method looks like this: -(void) emptyDataContext { NSMutableArray* mutableFetchResults = [CoreDataHelper getObjectsFromContext:@"Condition" :@"road" :NO :managedObjectContext]; NSFetchRequest * allCon = [[NSFetchRequest alloc] init]; [allCon setEntity:[NSEntityDescription entityForName:@"Condition" inManagedObjectContext:managedObjectContext]]; NSError * error = nil; NSArray * conditions = [managedObjectContext executeFetchRequest:allCon error:&error]; [allCon release]; for (NSManagedObject * condition in conditions) { [managedObjectContext deleteObject:condition]; } } The first time this runs it deletes all objects and functions as it should - creating new objects from the xml file. I created a 'update' button that starts the exact same process of retrieving the file the preceeding as it did the first time. All is well until its time to delete the core data objects again. This 'deleteObject' call creates a "EXC_BAD_ACCESS" error each time. This only happens on the second time through. See this image for the debugger window as it appears when walking through the deletion FOR loop on the second iteration. Conditions is the fetched array of 7 objects with the objects below. Condition should be an individual condition. link text As you can see 'condition' does not match any of the objects in the 'conditions' array. I'm sure this is why I'm getting the memory access errors. Just not sure why this fetch (or the FOR) is returning a wrong reference. All the code that successfully performes this function on the first iteration is used in the second but with very different results. Thanks in advance for the help!

    Read the article

  • Memory leak at NSObject allocation

    - by Srilakshmi Manthena
    HI, I am getting memory leak at NSObject allocation i.e., ContactDTO* contactDTO = [[ContactDTO alloc] init]; Code: +(ContactDTO*) getContactDTOForId:(NSString*) contactId { NSString* homeMail =@""; NSString* workMail=@""; NSString *lastNameString=@""; NSString *firstNameString=@""; firstNameString = [AddressBookUtil getValueForProperty:kABPersonFirstNameProperty forContact:contactId]; lastNameString = [AddressBookUtil getValueForProperty:kABPersonLastNameProperty forContact:contactId]; ABRecordID contactIntId = [contactId intValue]; ABRecordRef person = ABAddressBookGetPersonWithRecordID(addressBook, contactIntId); ABMultiValueRef emailMultiValue =(NSString *)ABRecordCopyValue(person, kABPersonEmailProperty); for(CFIndex j=0;j<ABMultiValueGetCount(emailMultiValue);j++) { NSString* curentTypeLabel =(NSString *)ABMultiValueCopyLabelAtIndex(emailMultiValue,j); if([curentTypeLabel isEqualToString:@"_$!<Home>!$_"]==YES) { NSString* currentEmail =(NSString *)ABMultiValueCopyValueAtIndex(emailMultiValue,j); if([currentEmail isEqualToString:nil]==NO) { homeMail = [currentEmail copy]; } } if([curentTypeLabel isEqualToString:@"_$!<Work>!$_"]==YES) { NSString* currentEmail =(NSString *)ABMultiValueCopyValueAtIndex(emailMultiValue,j); if([currentEmail isEqualToString:nil]==NO) { workMail = [currentEmail copy]; } } } ContactDTO* contactDTO = [[ContactDTO alloc] init]; contactDTO.firstName = firstNameString; contactDTO.lastName = lastNameString; contactDTO.contactId = contactId; contactDTO.homeEmail = homeMail; contactDTO.workEmail = workMail; return [contactDTO autorelease]; }

    Read the article

  • Performing a SVD on tweets. Memory problem

    - by plotti
    I have generated a huge csv file as an output from my pos tagging and stemming. It looks like this: word1, word2, word3, ..., word14400 person1 1 2 0 1 person2 0 0 1 0 ... person650 It contains the word counts for each person. Like this I am getting characteristic vectors for each person. I want to run a SVD on this beast, but it seems the matrix is too big to be held in memory to perform the operation. My quesion is: should i reduce the column size by removing words which have a column sum of for example 1, which means that they have been used only once. Do I bias the data too much with this attempt? I tried the rapidminer attempt, by loading the csv into the db. and then sequentially reading it in with batches for processing, like rapidminer proposes. But Mysql can't store that many columns in a table. If i transpose the data, and then retranspose it on import it also takes ages.... -- So in general I am asking for advice how to perform a svd on such a corpus.

    Read the article

  • Python 2.7.3 memory error

    - by Tom Baker
    I have a specific case with python code. Every time I run the code, the RAM memory is increasing until it reaches 1.8 gb and crashes. import itertools import csv import pokersleuth cards = ['2s', '3s', '4s', '5s', '6s', '7s', '8s', '9s', 'Ts', 'Js', 'Qs', 'Ks', 'As', '2h', '3h', '4h', '5h', '6h', '7h', '8h', '9h', 'Th', 'Jh', 'Qh', 'Kh', 'Ah', '2c', '3c', '4c', '5c', '6c', '7c', '8c', '9c', 'Tc', 'Jc', 'Qc', 'Kc', 'Ac', '2d', '3d', '4d', '5d', '6d', '7d', '8d', '9d', 'Td', 'Jd', 'Qd', 'Kd', 'Ad'] flop = itertools.combinations(cards,3) a1 = 'Ks' ; a2 = 'Qs' b1 = 'Jc' ; b2 = 'Jd' cards1 = a1+a2 cards2 = b1+b2 number = 0 n=0 m=0 for row1 in flop: if (row1[0] <> a1 and row1[0] <>a2 and row1[0] <>b1 and row1[0] <>b2) and (row1[1] <> a1 and row1[1] <>a2 and row1[1] <>b1 and row1[1] <>b2) and (row1[2] <> a1 and row1[2] <> a2 and row1[2] <> b1 and row1[2] <> b2): for row2 in cards: if (row2 <> a1 and row2 <> a2 and row2 <> b1 and row2 <> b2 and row2 <> row1[0] and row2 <> row1[1] and row2 <> row1[2]): s = pokersleuth.compute_equity(row1[0]+row1[1]+row1[2]+row2, (cards1, cards2)) if s[0]>=0.5: number +=1 del s[:] del s[:] print number/45.0 number = 0 n+=1

    Read the article

  • getting an exception when refreshing the configuration in memory on change to external config file

    - by RKP
    Hi, I have a windows service which reads the config settings from an external file which is located at a different path than the path to the executable for the windows service. the windows service uses a FileSystemWatcher to monitor the changes to the external config file and when it the config file is changed, it should refresh the settings in memory by reading the updated settings from the config file. but this is where I am getting an exception "ConfigurationErrorsException" and the message is "An error occurred creating the configuration section handler for appSettings: The process cannot access the file 'M:\somefolder\WindowsService1.Config' because it is being used by another process." and the inner exception is actually "IOException" with same message. here is the code. I am not sure what is wrong with the code. Please help. protected void watcher_Changed(object sender, FileSystemEventArgs e) { ConfigurationManager.RefreshSection(ConfigSectionName); WriteToEventLog(ConfigKeyCheck); if (FileChanged != null) FileChanged(this, EventArgs.Empty); } private void WriteToEventLog(string key) { if (EventLog.SourceExists(ServiceEventSource)) { EventLog.WriteEntry(ServiceEventSource, string.Format("key:{0}, value:{1}", key, ConfigurationManager.AppSettings[key])); } }

    Read the article

  • Memory optimization while downloading

    - by lboregard
    hello all i have the following piece of code, that im looking forward to optimize, since i'm consuming gobs of memory this routine is heavily used first optimization would be to move the stringbuilder construction out of the download routine and make it a field of the class, then i would clear it inside the routine can you please suggest any other optimization or point me in the direction of some resources that could help me with this (web articles, books, etc). i'm thinking about replacing the stringbuilder by a fixed (much larger) size buffer ... or perhaps create a larger sized stringbuilder thanks in advance. StreamWriter _writer; StreamReader _reader; public string Download(string msgId) { _writer.WriteLine("BODY <" + msgId + ">"); string response = _reader.ReadLine(); if (!response.StartsWith("222")) return null; bool done = false; StringBuilder body = new StringBuilder(256* 1024); do { response = _reader.ReadLine(); if (OnProgress != null) OnProgress(response.Length); if (response == ".") { done = true; } else { if (response.StartsWith("..")) response = response.Remove(0, 1); body.Append(response); body.Append("\r\n"); } } while (!done); return body.ToString(); }

    Read the article

  • Textblock doesnt get updated when rendered in memory?

    - by veechi
    I have a text block which as part of a custom control.I added the custom control as a child of grid which in turn is added as child of a Canvas.All of these contorl are instantiated in memory and are not rendered on the UI.When I update the value of the TextBlock and emboss the canvas on an image, the updated value doesnt appear on the embossed image.Here is the code snippet:- System.Windows.Controls.Canvas embossCanvas = new System.Windows.Controls.Canvas(); System.Windows.Controls.Grid grid = new Grid(); MyControl myctrl= new MyControl(); int wd = (int)myctrl.ActualWidth; int ht = (int)myctrl.ActualHeight; embossCanvas.Width = wd; embossCanvas.Height = ht; grid.Children.Add(myctrl); embossCanvas.Children.Add(grid); myctrl.txtBlk.UpdateLayout(); grid.UpdateLayout(); embossCanvas.Measure(new System.Windows.Size(embossCanvas.Width, embossCanvas.Height)); embossCanvas.Arrange(new System.Windows.Rect(0, 0, embossCanvas.Width, (int)embossCanvas.Height)); embossCanvas.UpdateLayout(); RenderTargetBitmap renderBmp = new RenderTargetBitmap(wd, ht, 96, 96, System.Windows.Media.PixelFormats.Default); renderBmp.Render(embossCanvas);

    Read the article

  • memory leak when removing objects in NSMutableArray

    - by user262325
    Hello everyone I hope to store MYFileObj to NSMutableArray (fileArray) and display data on an UITavleView(tableview). //----------------------------------MYFileObj #import <UIKit/UIKit.h> @interface MYFileObj : NSObject { NSString *fileName; } -(void) setFileName:(NSString *)s ; -(NSString *) fileName ; @end the array I want to store data NSMutableArray *fileArray; I created new object and add to fileArray MYFileObj *newobj=[[MYFileObj alloc] init ]; NSString *ss=[[NSString alloc] initWithFormat:@"%@",path] ; [newobj setFileName:ss]; [ss release]; [fileArray addObject:newobj]; [newobj release]; [atableview reloadData]; After the first time relaodData and do something, I want to reload fileArray and redraw atableview. //code to remove all object in atableview if([fileArray count]>0) { [fileArray removeAllObjects]; [atableview reloadData]; } I notice that there are memory leak. I hope to know the method "removeAllObjects" removes only MYFileObj themselves or also removes MYFileObj's member property "fileName"? Thanks interdev

    Read the article

< Previous Page | 108 109 110 111 112 113 114 115 116 117 118 119  | Next Page >