Results 1 to 17 of 17

Thread: QHash : Virtual memory not released

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Re: QHash : Virtual memory not released

    I understand what you are saying, theorically...

    Pratically, I am not sure where to begin.

    My problem look like a fragmentation problem.

    So, how can I defragment my memory in my application ? Pratically speeking...

    To be more precise :

    All in c++, using QT, on Windows OS

    1) In c++, how can I disabled swap during run-time ?

    2) In c++, how can I allocate more than all the free memory on your system using another process during run-time?

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    6
    Thanked 348 Times in 333 Posts

    Default Re: QHash : Virtual memory not released

    Both 1 and 2 are a bad idea for a typical application, so don't do either.

  3. #3

    Default Re: QHash : Virtual memory not released

    Ok. So, what can I do ?

    There is what I want *need* to do in my app :

    1) Allocate a large block of continous memory (cvCreateMat, from openCV)
    2) I need to allocate many small block (QHash, for example, and others things) that mess up my fragmentation.
    3) Deallocated the memory from 1)
    4) Allocate large block of memory for PCA analysis.
    5) Deallocated memory from 2) and 4)


    And I need to repeat step 1 to 5 a couple of times.

    The problem is that, when I try to redo step 1 for the second time, my memory is fragmented and I get a "inssuficient memory".

    If I don't do step 3 (in order to reuse the matrice for the next iteration), I got an error on step 4 : "insufficient memor".


    Any clues on what should I do ?

  4. #4
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    6
    Thanked 348 Times in 333 Posts

    Default Re: QHash : Virtual memory not released

    Which is the larger amount of memory required - cvCreateMat or the PCA analysis? Allocate it once and use it for both? Why deallocate when your going to need it again shortly anyway? Even if it is for another task.

Similar Threads

  1. Virtual memory allocation problem
    By morfei in forum Qt Programming
    Replies: 1
    Last Post: 27th August 2009, 11:30
  2. free up the memory used by QHash
    By vishal.chauhan in forum Qt Programming
    Replies: 8
    Last Post: 22nd June 2009, 19:13
  3. Q3ScrollView resists to scroll down to the garbage bin
    By sivrisinek in forum Qt Programming
    Replies: 0
    Last Post: 5th February 2009, 17:50
  4. Virtual memory problem
    By Rahul in forum Qt Programming
    Replies: 1
    Last Post: 24th October 2007, 13:29
  5. Virtual Memory in Qt 4.2.2
    By Shuchi Agrawal in forum Newbie
    Replies: 3
    Last Post: 5th March 2007, 23:38

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.