The Notebook Review forums were hosted by TechTarget, who shut down them down on January 31, 2022. This static read-only archive was pulled by NBR forum users between January 20 and January 31, 2022, in an effort to make sure that the valuable technical information that had been posted on the forums is preserved. For current discussions, many NBR forum users moved over to NotebookTalk.net after the shutdown.
Problems? See this thread at archive.org.

    A good memory defragmenter?

    Discussion in 'Windows OS and Software' started by HerrKaputt, Jun 10, 2009.

  1. HerrKaputt

    HerrKaputt Elite Notebook User

    Reputations:
    444
    Messages:
    2,510
    Likes Received:
    0
    Trophy Points:
    55
    Hello guys,

    Due to the limitations of 32-bit systems and the need to handle very large arrays in MATLAB I'd like to know whether there is a good free memory defragmenter so that the maximum array size becomes close to the amount of free RAM.

    Thanks in advance for any tips!
     
  2. DetlevCM

    DetlevCM Notebook Nobel Laureate

    Reputations:
    4,843
    Messages:
    8,389
    Likes Received:
    1
    Trophy Points:
    205
    There is no point in getting one on Vista.

    If you need more RAM than is free then Vista will page out stuff to make space for it.

    Also, if you trully have huge amounts of data that need to be in the memory, you may be better off with a 64Bit System and more RAM - not sure if Matlab supports 64Bit though.
     
  3. ScuderiaConchiglia

    ScuderiaConchiglia NBR Vaio Team Curmudgeon

    Reputations:
    2,674
    Messages:
    6,039
    Likes Received:
    0
    Trophy Points:
    205
    Are you saying that the maximum array size is limited to the largest CONTIGUOUS chunk of memory available to the application? That seems a bit odd.

    Gary
     
  4. newsposter

    newsposter Notebook Virtuoso

    Reputations:
    801
    Messages:
    3,881
    Likes Received:
    0
    Trophy Points:
    105
    The off switch is the best memory defragmenter available.

    Vista (and Server 2003+ and Win7) have this thing called memory space randomization. Among lots of other things, it means that you'll never get a 'real' contiguous chunk of ram bigger than a certain amount. I seem to remember that this is 16Mb but I could be mis-remembering.

    The OS will give an application as much ram as it's asking for, the details of the memory allocation are all hidden under the covers as it should be.
     
  5. jackluo923

    jackluo923 Notebook Virtuoso

    Reputations:
    1,038
    Messages:
    3,071
    Likes Received:
    1
    Trophy Points:
    105
    Off switch does not defragment your memory.

    There's no need to defrag your memory hense the name "RAM -random access memory".

    How much ram do you have?

    If you have around 3-4GB, the maximum ram you can use is 2GB per program unless you use the "3GB" trick to lift the limit.
     
  6. stonesrubber

    stonesrubber Notebook Consultant

    Reputations:
    6
    Messages:
    269
    Likes Received:
    0
    Trophy Points:
    30
    hoe do you use the 3gb trick?
     
  7. Greg

    Greg Notebook Nobel Laureate

    Reputations:
    7,857
    Messages:
    16,212
    Likes Received:
    58
    Trophy Points:
    466
    It involved using a Windows boot time command. It is known to cause instability of Windows unless you *really* know what you are doing.

    But you have to have access to more than 3GB of RAM to use it. Most computers in a 32bit OS can only use 3.25-3.5GB of RAM, so the 3GB flag leaves VERY little RAM to the OS and that WILL cause problems.

    Not worth risking. If you really need more RAM for MATLAB, I suggest you try out 64bit Vista or Linux (MATLAB should support it).

    And you do not need to defragment RAM, there is no point. Also, the OS will make sure the programs get the RAM they ask for (up to 2GB) using paging techniques and stuff of that sort. It is transparent to the application, and you don't need to worry about that.
     
  8. stonesrubber

    stonesrubber Notebook Consultant

    Reputations:
    6
    Messages:
    269
    Likes Received:
    0
    Trophy Points:
    30
    Wow, thanks a ton greg. i have acess to 4gig of ram and going by what your saying i dont need to go the windows boot command way
     
  9. jackluo923

    jackluo923 Notebook Virtuoso

    Reputations:
    1,038
    Messages:
    3,071
    Likes Received:
    1
    Trophy Points:
    105
    If you're using 32bit OS, it's impossible to have access to 4gig of ram because essential devices takes away some memory addressing space.

    If your program needs more than 2GB of memory, time to upgrade to 64bit OS and get more ram, maybe with the exception of virtual machines.

    I had 8 virtual machine running couple month ago. It used 3.5GB of ram and around 8-10GB of page file.
     
  10. Sc4Freak

    Sc4Freak Notebook Geek

    Reputations:
    94
    Messages:
    90
    Likes Received:
    0
    Trophy Points:
    15
    There are a couple of problems involved here.

    Each application has its own virtual address space. When you allocate memory, it needs to be in a contiguous chunk in the application's address space. The memory doesn't have to be contiguous in RAM (ie. the OS's address space) because each page in the application's virtual address space can map to any arbitrary page in the OS's address space.

    Hence, defragmenting the OS's address space won't help - you need to defragment the application's virtual address space if you want to allocate massive chunks of memory. And that's usually not possible - to relocate a piece of memory in an application's address space, you need to find all references to that memory and update them to point to the new address. Unless the application was written using a garbage collected language, it's not possible.

    The solution, as others have mentioned, is to use a 64-bit OS and find a 64-bit version of MATLAB (if possible).
     
  11. Pirx

    Pirx Notebook Virtuoso

    Reputations:
    3,001
    Messages:
    3,005
    Likes Received:
    416
    Trophy Points:
    151
    Good to see at least one knowledgeable answer to the OP's question.... :rolleyes:

    Yes, of course Matlab is available in a 64bit version, and getting that together with a machine with plenty of memory is the only way to handle very large arrays in Matlab. Note that simply installing a 64bit OS on your current machine will not do much for you. If you go to the Mathworks web site there are some additional pointers and advice on that topic as well (so, for example, a clean reboot with a minimal number of loaded applications does help, to some extent).