Wiki

Clone wiki

TreeView3 / OutOfMemory

Dealing with out-of-memory errors

TreeView3 is a java application. Java decides upon application start how much memory to give to the app. Apps are not allowed to exceed this memory allotment. Each computer/OS has a default amount of memory it gives to any java application, and that default is based on different factors for different systems. In general, TreeView3 was written to support matrices of 6000 x 6000 (or other similarly sized dimensions). TreeView3 may work on larger datasets provided you have enough memory on your computer, however some functions may not work (specifically some features of exporting - see Export Memory Limitations below).

Out of Memory Errors

If you receive an out-of-memory error while running TreeView3, you have a few options. If you're lucky, TreeView3 caught this error and has offered you a few options:

  1. Make adjustments to what you're trying to do (e.g. export - turn off labels to decrease image resolution)
  2. Perform a 1-time restart of TreeView3 with more memory (if you have more memory available).
  3. Refer you to this page to learn how to make a permanent adjustment to the memory allocated to this copy of TreeView3 (Note, you will have to perform this adjustment anytime you update your copy of TreeView3). See Permanently Increase TreeView3 Memory below.

Permanently Increase TreeView3 Memory

Note, you will have to perform this adjustment anytime you update your copy of TreeView3.

Mac

  • Find the TreeView3 App in your Applications folder
  • Right-click the TreeView3 app and select "Show Package Contents"

tv3showpkgcont.png

  • Open the resulting "Contents" folder and drag the "Info.plist" file to your "TextEdit.app" application (you can find it in your Applications folder or by doing a spotlight search).

tv3plisttote.gif

  • Search the file to find a section that looks like this (note, the default memory is 4 Gigs -Xmx4g):
    <key>JVMOptions</key>
       <array>
          <string>-Xmx4g</string>
       </array>
    
  • Change the 4g (or whatever value occurs after -Xmx) to the number of gigs of memory of your choosing.
  • Save and close the Info.plist file

Linux

  1. Add a TREEVIEW3_OPTS environment variable to your shell's login script with the -Xmx flag containing the amount of memory you want. E.g. If you use bash, add export TREEVIEW3_OPTS="-Xmx6g" to your .bashrc file in your home directory (or setenv TREEVIEW3_OPTS "-Xmx6g" in your .cshrc if you use csh).
  2. Start TreeView3 on the command line using the treeview3 command.

Windows

Note, the following changes the default max memory system-wide for all java apps. To change the memory for just TreeView3, you must use the Command Prompt to start TreeView3.

  1. From the Desktop, right-click "My Computer" and click "Properties".
  2. Click "Advanced System Settings" in the left column.
  3. In the System Properties window, click the "Environment Variables" button.
  4. Click "New" to add a new variable name and value.
  5. For variable name, enter "JAVA_OPTS" and for variable value, enter (for example) -Xmx7g
  6. Click ok and close the System Properties Tab.

Export Memory Limitations

TreeView3 was enhanced for performance with large datasets by using image buffering. The buffered image object is also utilized for image export, however the BufferedImage class is limited to java's maximum integer value. The width and height, times the pixels per row/column is not allowed to exceed this value. When you add labels to an exported image, this can dramatically increase image resolution and thus, the pixels per row/column. Thus, the export interface grays-out options such as row & column labels when the image size is calculated to be too big.

We have explored options to work around this limitation, but since it seems unlikely to be useful to have an image containing tens of thousands of labels, it has not been a priority.

Developer's Note

This page's URL is linked to from TreeView3 and is used when out-of-memory errors are encountered. Do not move.

Updated