Search Results

Search found 16731 results on 670 pages for 'memory limit'.

Page 51/670 | < Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >

  • Keeping object in memory (iPhone SDK)

    - by Chris
    I am trying to create a UIImageView called theImageView in the touchesBegan method that I can then then move to a new location in touchesMoved. Currently I am receiving an "undeclared" error in touchesMoved where I set the new location for theImageView. What can I do to keep theImageView in memory between these two methods? - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { ... UIImageView *theImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"image.png"]]; theImageView.frame = CGRectMake(263, 228, 193, 300); [theImageView retain]; ... } - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { ... theImageView.frame = CGRectMake(300, 300, 193, 300); ... }

    Read the article

  • An explanation of memory usage on Windows server 2003

    - by Rich
    Hi, We've been working on a bit of puzzle at work. We have an application service installed on two machines, both running Windows server 2003. These services do exactly the same thing. However once loaded, one of the services uses 200mb less than the other service. We're at a bit of a loss to what might be causing this discrepancy. I was wondering if there was some kind of server setting that would cause an application to use more memory (heap block size) or anything to explain this. If anyone has any ideas on what may be causing this, or how to find out what is causing this I'd be very grateful. Cheers Rich

    Read the article

  • How to find out where my memory is going

    - by the_mandrill
    I've got the situation where the cycle of loading and then closing a document eats up a few Mb of RAM. This memory isn't being leaked as something owns it and cleans it up when the app exits (Visual Leak Detector and the Mac Leaks tool show agreement on this). However, I'd like to find out where it's going. I'm assuming it's some sort of cache in the application that gets populated when the document loads but not freed when the document is closed. Which methods or tools could I use to find out where these allocations are being made?

    Read the article

  • Advanced Memory Editing/Function Calling

    - by Saustin
    Hi, I've gotten extremely interested into coding trainers (Program that modifies value of a different process) for video games. I've done the simple 'god-mode' and 'unlimited money' things, but I want to do alot more than that. (Simple editing using WriteProcessMemory) There are memory addresses of functions on the internet of the video game I'm working on, and one of functions is like "CreateCar" and I'm wanting to call that function from an external program. My question: How can I call a function from an external process in C/C++, provided the function address, using a process handle or other method. PS: If anyone could link me to tools (I've got debuggers, no need for more..) that help with this sort of thing, that'd be nice.

    Read the article

  • Changing open-files-limit in mysql 5.5

    - by davidv
    I'm having an issue with mysql 5.5 running on Ubuntu 12.04 with the open-files-limit parameter. I recently noticed some problems due to the 1024 limit, and actually the main system limit was set to 1024, so I modified /etc/security/limits.conf with the following: * soft nofile 32000 * hard nofile 32000 root soft nofile 32000 root hard nofile 32000 After that I check the ulimit value for root and even for mysql user, both returned the new value: 32000, so I assume the change has already been done. I also changed the value at the my.cnf file, setting open-files-limit to 24000, like this: open-files-limit = 24000 Now comes the odd part, when I restart the mysql service and check the open_files_limit variable, it returns that it's still set to 1024, so I'm having the same problems that before (obviously), I tried to use open-files-limit instead open_files_limit in the my.cnf config file, same result, BUT if I override the service command to start the service and start only using mysqld (no additional parameters), the service starts and when I check the parameter it returns 32000... I don't know where it's taking that value from, as it's not set at my.cnf and it's not being given through command line, at least, not for myself. Any ideas about why it's not working the change and how to solve it the normal way (launching it through service...)?

    Read the article

  • How to avoid reallocation using the STL (C++)

    - by Tue Christensen
    This question is derived of the topic: http://stackoverflow.com/questions/2280655/vector-reserve-c I am using a datastructur of the type vector<vector<vector<double> > >. It is not possible to know the size of each of these vector (except the outer one) before items (doubles) are added. I can get an approximate size (upper bound) on the number of items in each "dimension". A solution with the shared pointers might be the way to go, but I would like to try a solution where the vector<vector<vector<double> > > simply has .reserve()'ed enough space (or in some other way has allocated enough memory). Will A.reserve(500) (assumming 500 is the size or, alternatively an upper bound on the size) be enough to hold "2D" vectors of large size, say [1000][10000]? The reason for my question is mainly because I cannot see any way of reasonably estimating the size of the interior of A at the time of .reserve(500). An example of my question: vector A; A.reserve(500+1); vector temp2; vector temp1 (666,666); for(int i=0;i<500;i++) { A.push_back(temp2); for(int j=0; j< 10000;j++) { A.back().push_back(temp1); } } Will this ensure that no reallocation is done for A? If temp2.reserve(100000) and temp1.reserve(1000) where added at creation will this ensure no reallocation at all will occur at all? In the above please disregard the fact that memory could be wasted due to conservative .reserve() calls. Thank you all in advance!

    Read the article

  • is this uibutton autoreleased ?

    - by dubbeat
    HI This is just a question to check my sanity really. I'm hunting memory leaks that show up in instruments but not the static analyzer. In one spot the analyzer is pointing to this block of code UIButton *randomButton = [UIButton buttonWithType:UIButtonTypeRoundedRect ]; randomButton.frame = CGRectMake(205, 145, 90, 22); // size and position of button [randomButton setTitle:@"Random" forState:UIControlStateNormal]; randomButton.backgroundColor = [UIColor clearColor]; randomButton.adjustsImageWhenHighlighted = YES; [randomButton addTarget:self action:@selector(getrandom:) forControlEvents:UIControlEventTouchUpInside]; [self.view addSubview:randomButton]; For some reason I thought the above code would auto release the button because I'm not calling init or alloc? If I add [randombutton release] at the bottom of the code my button fails to show. Could somebody describe to me the correct way to release a button from memory that is created in the above way? Or would I be better off making the button a class variable and sticking the release in the dealloc method?

    Read the article

  • Out of memory while iterating through rowset

    - by Phliplip
    Hi All, I have a "small" table of 60400 rows with zipcode data. I wan't to iterate through them all, update a column value, and then save it. The following is part of my Zipcodes model which extends My_Db_Table that a totalRows function that - you guessed it.. returns the total number of rows in the table (60400 rows) public function normalizeTable() { $this->getAdapter()->setProfiler(false); $totalRows = $this->totalRows(); $rowsPerQuery = 5; for($i = 0; $i < $totalRows; $i = $i + $rowsPerQuery) { $select = $this->select()->limit($i, $rowsPerQuery); $rowset = $this->fetchAll($select); foreach ($rowset as $row) { $row->{self::$normalCityColumn} = $row->normalize($row->{self::$cityColumn}); $row->save(); } unset($rowset); } } My rowClass contains a normalize function (basicly a metaphone wrapper doing some extra magic). At first i tried a plain old $this-fetchAll(), but got a out of memory (128MB) right away. Then i tried splitting the rowset into chunks, only difference is that some rows actually gets updated. Any ideas on how i can acomplish this, or should i fallback to ye'olde mysql_query()

    Read the article

  • Memory leak in PHP with Symfony + Doctrine

    - by Nicklas Ansman
    I'm using PHP with the Symfony framework (with Doctrine as my ORM) to build a spider that crawls some sites. My problem is that the following code generates a memory leak: $q = $this -> createQuery('Product p'); if($store) { $q -> andWhere('p.store_id = ?', $store -> getId()) -> limit(1); } $q -> andWhere('p.name = ?', $name); $data = $q -> execute(); $q -> free(true); $data -> free(true); return NULL; This code is placed in a subclass of Doctrine_Table. If I comment out the execute part (and of course the $data - free(true)) the leak stops. This has led me to the conclusion that it's the Doctrine_Collection that's causing the leak. Any ideas on what I can do to fix this? I'd be happy to provide more info on the problem if you need it. Regards Nicklas

    Read the article

  • Traditional IO vs memory-mapped

    - by Senne
    I'm trying to illustrate the difference in performance between traditional IO and memory mapped files in java to students. I found an example somewhere on internet but not everything is clear to me, I don't even think all steps are nececery. I read a lot about it here and there but I'm not convinced about a correct implementation of neither of them. The code I try to understand is: public class FileCopy{ public static void main(String args[]){ if (args.length < 1){ System.out.println(" Wrong usage!"); System.out.println(" Correct usage is : java FileCopy <large file with full path>"); System.exit(0); } String inFileName = args[0]; File inFile = new File(inFileName); if (inFile.exists() != true){ System.out.println(inFileName + " does not exist!"); System.exit(0); } try{ new FileCopy().memoryMappedCopy(inFileName, inFileName+".new" ); new FileCopy().customBufferedCopy(inFileName, inFileName+".new1"); }catch(FileNotFoundException fne){ fne.printStackTrace(); }catch(IOException ioe){ ioe.printStackTrace(); }catch (Exception e){ e.printStackTrace(); } } public void memoryMappedCopy(String fromFile, String toFile ) throws Exception{ long timeIn = new Date().getTime(); // read input file RandomAccessFile rafIn = new RandomAccessFile(fromFile, "rw"); FileChannel fcIn = rafIn.getChannel(); ByteBuffer byteBuffIn = fcIn.map(FileChannel.MapMode.READ_WRITE, 0,(int) fcIn.size()); fcIn.read(byteBuffIn); byteBuffIn.flip(); RandomAccessFile rafOut = new RandomAccessFile(toFile, "rw"); FileChannel fcOut = rafOut.getChannel(); ByteBuffer writeMap = fcOut.map(FileChannel.MapMode.READ_WRITE,0,(int) fcIn.size()); writeMap.put(byteBuffIn); long timeOut = new Date().getTime(); System.out.println("Memory mapped copy Time for a file of size :" + (int) fcIn.size() +" is "+(timeOut-timeIn)); fcOut.close(); fcIn.close(); } static final int CHUNK_SIZE = 100000; static final char[] inChars = new char[CHUNK_SIZE]; public static void customBufferedCopy(String fromFile, String toFile) throws IOException{ long timeIn = new Date().getTime(); Reader in = new FileReader(fromFile); Writer out = new FileWriter(toFile); while (true) { synchronized (inChars) { int amountRead = in.read(inChars); if (amountRead == -1) { break; } out.write(inChars, 0, amountRead); } } long timeOut = new Date().getTime(); System.out.println("Custom buffered copy Time for a file of size :" + (int) new File(fromFile).length() +" is "+(timeOut-timeIn)); in.close(); out.close(); } } When exactly is it nececary to use RandomAccessFile? Here it is used to read and write in the memoryMappedCopy, is it actually nececary just to copy a file at all? Or is it a part of memorry mapping? In customBufferedCopy, why is synchronized used here? I also found a different example that -should- test the performance between the 2: public class MappedIO { private static int numOfInts = 4000000; private static int numOfUbuffInts = 200000; private abstract static class Tester { private String name; public Tester(String name) { this.name = name; } public long runTest() { System.out.print(name + ": "); try { long startTime = System.currentTimeMillis(); test(); long endTime = System.currentTimeMillis(); return (endTime - startTime); } catch (IOException e) { throw new RuntimeException(e); } } public abstract void test() throws IOException; } private static Tester[] tests = { new Tester("Stream Write") { public void test() throws IOException { DataOutputStream dos = new DataOutputStream( new BufferedOutputStream( new FileOutputStream(new File("temp.tmp")))); for(int i = 0; i < numOfInts; i++) dos.writeInt(i); dos.close(); } }, new Tester("Mapped Write") { public void test() throws IOException { FileChannel fc = new RandomAccessFile("temp.tmp", "rw") .getChannel(); IntBuffer ib = fc.map( FileChannel.MapMode.READ_WRITE, 0, fc.size()) .asIntBuffer(); for(int i = 0; i < numOfInts; i++) ib.put(i); fc.close(); } }, new Tester("Stream Read") { public void test() throws IOException { DataInputStream dis = new DataInputStream( new BufferedInputStream( new FileInputStream("temp.tmp"))); for(int i = 0; i < numOfInts; i++) dis.readInt(); dis.close(); } }, new Tester("Mapped Read") { public void test() throws IOException { FileChannel fc = new FileInputStream( new File("temp.tmp")).getChannel(); IntBuffer ib = fc.map( FileChannel.MapMode.READ_ONLY, 0, fc.size()) .asIntBuffer(); while(ib.hasRemaining()) ib.get(); fc.close(); } }, new Tester("Stream Read/Write") { public void test() throws IOException { RandomAccessFile raf = new RandomAccessFile( new File("temp.tmp"), "rw"); raf.writeInt(1); for(int i = 0; i < numOfUbuffInts; i++) { raf.seek(raf.length() - 4); raf.writeInt(raf.readInt()); } raf.close(); } }, new Tester("Mapped Read/Write") { public void test() throws IOException { FileChannel fc = new RandomAccessFile( new File("temp.tmp"), "rw").getChannel(); IntBuffer ib = fc.map( FileChannel.MapMode.READ_WRITE, 0, fc.size()) .asIntBuffer(); ib.put(0); for(int i = 1; i < numOfUbuffInts; i++) ib.put(ib.get(i - 1)); fc.close(); } } }; public static void main(String[] args) { for(int i = 0; i < tests.length; i++) System.out.println(tests[i].runTest()); } } I more or less see whats going on, my output looks like this: Stream Write: 653 Mapped Write: 51 Stream Read: 651 Mapped Read: 40 Stream Read/Write: 14481 Mapped Read/Write: 6 What is makeing the Stream Read/Write so unbelievably long? And as a read/write test, to me it looks a bit pointless to read the same integer over and over (if I understand well what's going on in the Stream Read/Write) Wouldn't it be better to read int's from the previously written file and just read and write ints on the same place? Is there a better way to illustrate it? I've been breaking my head about a lot of these things for a while and I just can't get the whole picture..

    Read the article

  • Fermat factorization method limit

    - by Fakrudeen
    I am trying to implement Fermat's factorization [Algorithm C in Art of computer programming Vol. 2]. Unfortunately in my edition [ISBN 81-7758-335-2], this algorithm is printed incorrectly. what should be the condition on factor-inner loop below? I am running the loop till y <= n [passed in as limit]. (if (< limit y) 0 (factor-inner x (+ y 2) (- r y) limit)) Is there anyway to avoid this condition altogether, as it will double the speed of loop? (define (factor n) (let ( ( square-root (inexact->exact (floor (sqrt n))) ) ) (factor-inner (+ (* 2 square-root) 1) 1 (- (* square-root square-root) n) n) ) ) (define (factor-inner x y r limit) (if (= r 0) (/ (- x y) 2) (begin (display x)(display " ")(display y)(display " ")(display r)(newline) ;(sleep-current-thread 1) (if (< r 0) (factor-inner (+ x 2) y (+ r x) limit) (if (< limit y) 0 (factor-inner x (+ y 2) (- r y) limit)) ) ) ) )

    Read the article

  • Enum exeeding the 65535 bytes limit of static initializer... what's best to do?

    - by Daniel Bleisteiner
    I've started a rather large Enum of so called Descriptors that I've wanted to use as a reference list in my model. But now I've come across a compiler/VM limit the first time and so I'm looking for the best solution to handle this. Here is my error : The code for the static initializer is exceeding the 65535 bytes limit It is clear where this comes from - my Enum simply has far to much elements. But I need those elements - there is no way to reduce that set. Initialy I've planed to use a single Enum because I want to make sure that all elements within the Enum are unique. It is used in a Hibernate persistence context where the reference to the Enum is stored as String value in the database. So this must be unique! The content of my Enum can be devided into several groups of elements belonging together. But splitting the Enum would remove the unique safety I get during compile time. Or can this be achieved with multiple Enums in some way? My only current idea is to define some Interface called Descriptor and code several Enums implementing it. This way I hope to be able to use the Hibernate Enum mapping as if it were a single Enum. But I'm not even sure if this will work. And I loose unique safety. Any ideas how to handle that case?

    Read the article

  • How do I increase the open files limit for a non-root user?

    - by iCode
    This is happening on Ubuntu Release 12.04 (precise) 64-bit Kernel Linux 3.2.0-25-virtual I'm trying to increase the number of open files allowed for a user. This is for an my ecplise java application where the current limit of 1024 is not enough. According to the posts I've found so far, I should be able to put lines into /etc/security/limits.conf like this; soft nofile 4096 hard nofile 4096 to increase the number of open files allowed for all users. But, that's not working for me, and I think the problem is not related to that file. For all users, the default limit is 1024, regardless of what is in /etc/security/limits.conf (I have been rebooting after changing that file) $ ulimit -n 1024 Now, despite the entries in /etc/security/limits.conf I can't increase that; $ ulimit -n 2048 -bash: ulimit: open files: cannot modify limit: Operation not permitted The weird part is that I can change the limit downwards, but can't change it upwards - even to go back to a number which is below the original limit; $ ulimit -n 800 $ ulimit -n 800 $ ulimit -n 900 -bash: ulimit: open files: cannot modify limit: Operation not permitted As root, I can change that limit to whatever I want, up or down. It doesn't even seem to care about the supposedly system-wide limit in /proc/sys/fs/file-max # cat /proc/sys/fs/file-max 188897 # ulimit -n 188898 # ulimit -n 188898 So far, I haven't found any way to increase the open files limit for a non-root user, and I really don't want to be running my application as root. How should I properly do this? I have looked at all the posted and tried the given options but no luck!

    Read the article

  • Is it the address bus size or the data bus size that determines "8-bit , 16-bit ,32-bit ,64-bit " systems?

    - by learner
    My simple understanding is as follows. Memory (RAM) is composed of bits, groups of 8 which form bytes, each of which can be addressed ,and hence byte addressable memory. Address Bus stores the location of a byte of memory. If an address bus is of size 32 bits, that means it can hold upto 232 numbers and it hence can refer upto 232 bytes of memory = 4GB of memory and any memory greater than that is useless. Data bus is used to send the value to be written to/read off the memory. If I have a data bus of size 32 bits, it means a maximum of 4 bytes can be written to/read off the memory at a time. I find no relation between this size and the maximum memory size possible. But I read here that: Even though most systems are byte-addressable, it makes sense for the processor to move as much data around as possible. This is done by the data bus, and the size of the data bus is where the names 8-bit system, 16-bit system, 32-bit system, 64-bit system, etc.. come from. When the data bus is 8 bits wide, it can transfer 8 bits in a single memory operation. When the data bus is 32 bits wide (as is most common at the time of writing), at most, 32 bits can be moved in a single memory operation. This says that the size of the data bus is what gives an OS the name, 8bit, 16bit and so on. What is wrong with my understanding?

    Read the article

  • GA 8KNXP Rev1.0: 4 GB installed, only 3.5 GB recognized by BIOS

    - by hurikhan77
    I've installed 2x 1 GB and 4x 512 MB memory into my GA-8KNXP system which would sum up to 4 GB. The specification from the manual says: Maximum memory support: 4 GB. If all six slots are utilized, slot 5+6 may only equipped with single-sided RAM modules. And so I did. Anyway: The BIOS counts up to 3.5 GB and finishes there. Also my Linux system reports only 3.5 GB of memory although 4 GB memory support is activated in the kernel. So I suppose this is a memory mapping issue or a hardware issue. I've tried removing only on of the 512 MB memory modules leaving 5 modules in place. But that just stopped the system from powering on correctly (screen stays black although fans and leds come to live). Dual Channel was detected and enabled so the system technically found all 6 modules. "dmidecode" in Linux reports only memory in slots 1 to 4 and ignores slots 5+6, so it only detects 3 GB of memory. It also says the system would support up to 16 GB of memory with 4 GB modules per slot. I think technically the chipset should be able to offer and utilize the complete 4 GB memory range. Any clues what else I could check? Or do I have just to live with 0.5 GB wasted memory?

    Read the article

  • GA 8KNXP Rev1.0: 4GB installed, only 3.5 recognized by BIOS

    - by hurikhan77
    I've installed 2x 1 GB and 4x 512 MB memory into my GA-8KNXP system which would sum up to 4GB. The specs from the manual say: Maximum memory support: 4GB. If all six slots are utilized, slot 5+6 may only equipped with single-sided RAM modules. And so I did. Anyway: The BIOS counts up to 3.5 GB and finishes there. Also my linux system reports only 3.5 GB of memory although 4 GB memory support is activated in the kernel. So I suppose this is a memory mapping issue or a hardware issue. I've tried removing only on of the 512 MB memory modules leaving 5 modules in place. But that just stopped the system from powering on correctly (screen stays black although fans and leds come to live). Dual Channel was detected and enabled so the system technically found all 6 modules. "dmidecode" in linux reports only memory in slots 1 to 4 and ignores slots 5+6, so it only detects 3 GB of memory. It also says the system would support up to 16 GB of memory with 4 GB modules per slot. I think technically the chipset should be able to offer and utilize the complete 4 GB memory range. Any clues what else I could check? Or do I have just to live with 0.5 GB wasted memory?

    Read the article

  • Memory leaks with UIWebView and NSURL: already spent several days trying to solve them

    - by Sander de Jong
    I have already found a lot of information about how to solve memory leaks for iPhone Obj C code. The last two leaks keep me puzzled, I'm probably overlooking something. Maybe you can spot it. Instruments reports 2 leaks for the following code (part of a UIViewController subclass): (1) UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0.0, 0.0, self.view.bounds.size.width, self.view.bounds.size.height - LOWER_VERT_WINDOW_MARGIN)]; (2) webView.scalesPageToFit = YES; (3) webView.dataDetectorTypes = UIDataDetectorTypeNone; (4) (5) NSURL *url = [NSURL fileURLWithPath:self.fullPathFileName isDirectory:NO]; (6) NSMutableURLRequest *urlRequest = [[NSMutableURLRequest alloc] initWithURL:url]; (7) [webView loadRequest:urlRequest]; (8) [urlRequest release], urlRequest = nil; (9) [self.view addSubview:webView]; (10) [webView release], webView = nil; Instruments claims 128 bytes are leaking in line 1, as well as 256 bytes in line 4. No idea if it means line 3 or line 5. Does anybody have a clue what I'm overlooking?

    Read the article

  • ServerIdentity memory leak with IHttpAsyncHandler

    - by Anton
    I have a .NET web application that consists of a single HTTP handler class that implements IHttpAsyncHandler. All requests to this handler are handled asynchronously, though some requests are short-lived and some are long-lived (nothing over a few seconds). The problem is that memory consumption grows over time as requests are handled. All profiling results point to an unbounded growth of String objects held by instances of System.Runtime.Remoting.ServerIdentity. Every String value is different, but they all look similar to: /dd41c00e_1566_4702_b660_c81cdea18a43/vigefresi5pfv8n0ekddg57z_1154.rem There is nothing in my application that uses ServerIdentity directly, and unless I am mistaken, the ServerIdentity instances are proportional to the number of incoming requests. If this is an internal .NET structure, it looks like the CLR is not cleaning up after itself. What could be causing the leak? UPDATE A little less than half of the String objects are being held by System.Runtime.Remoting. The remaining String objects are being held by System.Runtime.Serialization and look similar to: +1sgess5rjcrgbmp3kqr6bmv_3474.rem Also, the problem only seems to occur when lots of simultaneous HTTP web requests arrive.

    Read the article

  • Silverlight DataForm Memory Leak

    - by Andrew Garrison
    Some Background I have noticed that setting the EditTemplate of a DataForm (from the Silverlight Toolkit) can cause the DataForm to not be garbage collected. Consequently, the parent control of the DataForm cannot be garbage collected either, causing a very significant memory leak. Here's some XAML which demonstrates the case. <toolkit:DataForm HorizontalAlignment="Stretch" Margin="10" VerticalAlignment="Stretch"> <toolkit:DataForm.EditTemplate> <DataTemplate> <toolkit:DataField Label="Dummy Binding:"> <TextBox Text="{Binding DummyBinding, Mode=TwoWay}" /> </toolkit:DataField> </DataTemplate> </toolkit:DataForm.EditTemplate> </toolkit:DataForm> I have opened an issue on CodePlex. The isssue has an attachment which has a project which desmonstrates the case. So, My Question Is Has anyone else encountered this issue? More importantly, does anyone know of any workarounds? How can I force this DataForm to be garbage collected?

    Read the article

  • Method for finding memory leak in large Java heap dumps

    - by Rickard von Essen
    I have to find a memory leak in a Java application. I have some experience with this but would like advice on a methodology/strategy for this. Any reference and advice is welcome. About our situation: Heap dumps are larger than 1 GB We have heap dumps from 5 occasions. We don't have any test case to provoke this. It only happens in the (massive) system test environment after at least a weeks usage. The system is built on a internally developed legacy framework with so many design flaws that they are impossible to count them all. Nobody understands the framework in depth. It has been transfered to one guy in India who barely keeps up with answering e-mails. We have done snapshot heap dumps over time and concluded that there is not a single component increasing over time. It is everything that grows slowly. The above points us in the direction that it is the frameworks homegrown ORM system that increases its usage without limits. (This system maps objects to files?! So not really a ORM) Question: What is the methodology that helped you succeed with hunting down leaks in a enterprise scale application?

    Read the article

  • How to remove NSString Related Memory Leaks?

    - by Rahul Vyas
    in my application this method shows memory leak how do i remove leak? -(void)getOneQuestion:(int)flashcardId categoryID:(int)categoryId { flashCardText = [[NSString alloc] init]; flashCardAnswer=[[NSString alloc] init]; //NSLog(@"%s %d %s", __FILE__, __LINE__, __PRETTY_FUNCTION__, __FUNCTION__); sqlite3 *MyDatabase; sqlite3_stmt *CompiledStatement=nil; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask,YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *MyDatabasePath = [documentsDirectory stringByAppendingString:@"/flashCardDatabase.sqlite"]; if(sqlite3_open([MyDatabasePath UTF8String],&MyDatabase) == SQLITE_OK) { sqlite3_prepare_v2(MyDatabase, "select flashCardText,flashCardAnswer,flashCardTotalOption from flashcardquestionInfo where flashCardId=? and categoryId=?", -1, &CompiledStatement, NULL); sqlite3_bind_int(CompiledStatement, 1, flashcardId); sqlite3_bind_int(CompiledStatement, 2, categoryId); while(sqlite3_step(CompiledStatement) == SQLITE_ROW) { self.flashCardText = [NSString stringWithUTF8String:(char *)sqlite3_column_text(CompiledStatement,0)]; self.flashCardAnswer= [NSString stringWithUTF8String:(char *)sqlite3_column_text(CompiledStatement,1)]; flashCardTotalOption=[[NSNumber numberWithInt:sqlite3_column_int(CompiledStatement,2)] intValue]; } sqlite3_reset(CompiledStatement); sqlite3_finalize(CompiledStatement); sqlite3_close(MyDatabase); } } this method also shows leaks.....what's wrong with this method? -(void)getMultipleChoiceAnswer:(int)flashCardId { if(optionsList!=nil) [optionsList removeAllObjects]; else optionsList = [[NSMutableArray alloc] init]; sqlite3 *MyDatabase; sqlite3_stmt *CompiledStatement=nil; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask,YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *MyDatabasePath = [documentsDirectory stringByAppendingString:@"/flashCardDatabase.sqlite"]; if(sqlite3_open([MyDatabasePath UTF8String],&MyDatabase) == SQLITE_OK) { sqlite3_prepare_v2(MyDatabase,"select OptionText from flashCardMultipleAnswer where flashCardId=?", -1, &CompiledStatement, NULL); sqlite3_bind_int(CompiledStatement, 1, flashCardId); while(sqlite3_step(CompiledStatement) == SQLITE_ROW) { [optionsList addObject:[NSString stringWithUTF8String:(char *)sqlite3_column_text(CompiledStatement,0)]]; } sqlite3_reset(CompiledStatement); sqlite3_finalize(CompiledStatement); sqlite3_close(MyDatabase); } }

    Read the article

  • shared memory STL maps

    - by user306963
    Hello, I am writing an Apache module in C++. I need to store the common data that all childs need to read as a portion of shared memory. Structure is kind of map of vectors, so I want to use STL map and vectors for it. I have written a shared allocator and a shared manager for the purpose, they work fine for vectors but not for maps, below is the example: typedef vector<CustomersData, SharedAllocator<CustomersData> > CustomerVector; CustomerVector spData; //this one works fine typedef SharedAllocator< pair< const int, CustomerVector > > PairAllocator; typedef map< int, CustomerVector, less<int>, PairAllocator > SharedMap; SharedMap spIndex; //this one doesn't work I get compile time errors when I try to use the second object (spIndex), which are someting like: ../SpatialIndex.h:97: error: '((SpatialIndex*)this)-SpatialIndex::spIndex' does not have class type It looks like the compiler cannot determine a type for SharedMap template type, which is strange in my opinion, it seems to me that all the template parameters have been specified. Can you help? Thanks Benvenuto

    Read the article

  • Memory Leak question

    - by franz
    I am having a memory leak issue with the following code. As much as I can tell I don't see why the problem persists but it still does not release when called. I am detecting the problem in instruments and the following code is keeping its "cards" classes alive even when it should had released them. Any help welcome. ... ... -(id)initDeckWithCardsPicked: (NSMutableArray*)cardsPicked andColors:(NSMutableArray*)cardColors { self = [self init]; if (self != nil) { int count = [cardsPicked count]; for (int i=0; i<count; i++) { int cardNum = [[cardsPicked objectAtIndex:i] integerValue]; Card * card = [[MemoryCard alloc] initWithSerialNumber:cardNum position: CGPointZero color:[cardColors objectAtIndex:i]]; [_cards addObject: card]; [card release]; } } return self; } - (id) init { self = [super init]; if (self != nil) { self.bounds = (CGRect){{0,0},[Card cardSize]}; self.cornerRadius = 8; self.backgroundColor = kAlmostInvisibleWhiteColor; self.borderColor = kHighlightColor; self.cards = [NSMutableArray array]; } return self; } ... ...

    Read the article

  • Entity framework memory leak after detaching newly created object

    - by Tom Peplow
    Hi, Here's a test: WeakReference ref1; WeakReference ref2; TestRepositoryEntitiesContainer context; int i = 0; using (context = GetContext<TestRepositoryEntitiesContainer>()) { context.ObjectMaterialized += (o, s) => i++; var item = context.SomeEntities.Where(e => e.SomePropertyToLookupOn == "some property").First(); context.Detach(item); ref1 = new WeakReference(item); var newItem = new SomeEntity {SomePropertyToLookupOn = "another value"}; context.SomeEntities.AddObject(newItem); ref2 = new WeakReference(newItem); context.SaveChanges(); context.SomeEntities.Detach(newItem); newItem = null; item = null; } context = null; GC.Collect(); Assert.IsFalse(ref1.IsAlive); Assert.IsFalse(ref2.IsAlive); First assert passes, second fails... I hope I'm missing something, it is late... But it appears that detaching a fetched item will actually release all handles on the object letting it be collected. However, for new objects something keeps a pointer and creates a memory leak. NB - this is EF 4.0 Anyone seen this before and worked around it? Thanks for your help! Tom

    Read the article

< Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >