16 November 2010

New guide: How to find components causing memory leaks

(This guide, and others, can also been found in the Opus FAQs at the Directory Opus Resource Centre forums.)

Programs like Explorer and Directory Opus are at the mercy of the third-party components they load. This includes things like shell extensions and video codecs which may be added by other programs you have installed.

When those third-party components go wrong they can cause crashes or memory leaks within the programs they are loaded into. This post discusses a way to track down components causing memory leaks.

What is a memory leak?

A memory leak is when a program allocates memory and then doesn't give it back when it is no longer needed. The leaked memory is wasted because the program itself is no longer using it but nothing else can use it either until the program exits.

High memory usage does not always mean there is a memory leak. If you are doing something that inherently needs a lot of memory, and that memory is given back when the operation completes, then that is not a memory leak.

Memory leaks are usually unbounded. If you keep doing something that triggers a leak then the memory usage usually keeps increasing. (If the memory usage only increases the first time you do something, and the increase isn't huge, then it's probably just a component allocating a cache which it will re-use to speed up future operations. Such caches are often returned after a few minutes of inactivity, although it depends on the component.)

Using VMMap to find memory leaks

If you look using Task Manager it might say explorer.exe or dopus.exe are using a lot of memory but it won't tell you where the blame lies. There could be a bug in the programs themselves but it's almost always a third-party component. Here's how to find out which one.

Download the free VMMap tool from Microsoft/SysInternals and extract its zip file somewhere. VMMap is a low-level debugging tool but don't worry, what we're going to do with it is quite simple.

  1. Double-click VMMap.exe and it should open a window with a list of running processes.

    At the top of that window, click the Launch and trace a new process tab, then enter the path to dopus.exe, like below.

    Do not click OK yet.




  2. Before you click OK you need to exit Directory Opus (dopus.exe) so that it can be re-started by VMMap. (This will allow VMMap to keep a record of the memory allocations made by the new dopus.exe.)

    Simply closing all Opus windows will not exit it by default. Use the Exit option on Opus's tray-icon menu. (See also: How to Exit Directory Opus.)


  3. Now click OK in VMMap; it should re-start Opus.

    VMMap will also display a colourful list of numbers but don't worry about understanding them. :)

    Keep VMMap and Opus running; do not close either of them from now on.


  4. Use Directory Opus in a way which triggers your memory leak.

    Ideally, trigger the leak several times so it is large and easy to find. (Make it leak at least 10MB, or more if you can, so it stands out from other memory allocations.)

    Use the standard Task Manager to keep an eye on dopus.exe's memory usage so you can tell when you've triggered the leak.


  5. Return to VMMap and push F5 (or click View -> Refresh) to make it refresh.


  6. Click Trace... at the bottom of the VMMap window:




  7. In the Trace window which appears, sort by the Bytes column and scroll to the top of the list.

    It should look something like this where the first item has a much larger Bytes value than the others:



    If the first item doesn't have a relatively large Bytes value then you may need to trigger the leak more times (keep VMMap running and remember to Refresh it each time you come back to it), or you may be incorrect about there being a leak at all. Otherwise, continue...


  8. Select the first item and then click Stack... at the bottom of the Trace window.


  9. You will now see a list of DLLs (and dopus.exe) involved when the memory was allocated, like this:



    The component causing the memory leak is usually the first non-Windows DLL in the list. You can usually ignore the ones whose paths start with C:\Windows (e.g. ntdll.dll and user32.dll).

    In the example above, the memory leak was caused by LeakyShellExtension.dll which, as you can guess, is a shell extension I wrote for this guide which intentionally leaks memory. I wrote it to leak about 10MB each time a file was right-clicked and then right-clicked files a few times to make it leak about 70MB in total.


  10. Once you have a suspicious DLL the name and path are often enough to identify what it belongs to. If not, find the DLL on disk, right-click it, select Properties and then go to the Details tab. That will usually contain information about who made it and what it's a part of.

    Sometimes it's worth looking at some of the other DLLs in the list, too.

    Once you know what the DLL belongs to you can try uninstalling (or updating) it to see if the leak goes away.

    If the leak goes away then you know who to report the bug to.

    If the leak remains, repeat the process and see which DLLs are indicated. If it's the same DLL again then you know that you didn't successfully uninstall it. If it's another DLL, maybe the first one was innocent and can be reinstalled.

11 November 2010

Thumbnail plugin for Adobe Illustrator and EPS files

A new plugin has been released which gives Directory Opus the ability to display thumbnails of Adobe Illustrator (.ai) and EPS files.

This is a third-party plugin made by Ardfry Imaging and it requires their PSD Codec to work.

(While the plugin itself is free, the codec it depends on is US$19.95. There is a trial version so you can test it out. It also adds AI, EPS and Photoshop (PSD) thumbnails to Explorer, File-Open dialogs, etc. If you're wondering why it doesn't add PSD thumbnails to Opus as well it's just because Opus already understands PSD by itself.)

The plugin supports both 32-bit and 64-bit versions of Opus and Windows Vista/7. (The plugin doesn't support Windows XP.)

Head over to Ardfry's page for more information, download links, and some screenshots:

http://www.ardfry.com/psd-codec/view-eps-ai-thumbnails-in-Directory-Opus.html

It's great to see this plugin as I know several people on the Opus forum have requested something like it. Thanks to Ardfry!

14 October 2010

Directory Opus version 9.5.6.0

Directory Opus version 9.5.6.0 - October 14th 2010

A free update for all registered Directory Opus 9 users is now available for download from GP Software.

Direct Downloads:
Directory Opus x86 (32 bit)
Directory Opus x64 (64 bit)

Bugs fixed / minor changes:

  • Fixed crash that could occur if the Set SORTBY function was called with a column that wasn't currently displayed.
  • Drag & drop of attachments from Outlook to a folder tab now works correctly.
  • Fixed problem with slide-out back/forwards buttons where they would not notice the mouse was no longer over them if the mouse moved during the slide animation.
  • Fixed the Go command's OPENINDEST argument so that it will use an existing destination Lister if the current Lister is not a dual-display one.
  • Fix for the 'Open in Directory Opus' folder context menu item not working in Windows 7 if Explorer Replacement mode was disabled in some cases. This also fixes the 'Open folder to view files in Directory Opus' AutoPlay option if Explorer Replacement mode disabled.
  • Fixed crash when using the Print Folder command without any printers installed (or with print service disabled).
  • Fixed problem that prevented custom Folder Colors from working reliably in the tree.
  • If two or more files on an FTP site were selected and 'Open' chosen from the context menu, they would in some cases be downloaded and opened multiple times.
  • New FTP Proxy for USER: user@proxy_user@host and PASS: password@proxy_password
  • Fix for FTP sites that claim to support UTF-8 but return non-UTF-8 encoded directory listings.

6 October 2010

Directory Opus on Twitter

There is now a @Directory_Opus account on Twitter for those who prefer to get updates that way.

1 October 2010

Directory Opus version 9.5.5.2 (Beta)

This is an Opus Beta release only. If you aren't comfortable running the very latest version of Opus then you may like to wait for the next stable/public release.

To download the new beta version, visit the Directory Opus 9.5.5.2 thread.

Bugs fixed / minor changes:

  • Fixed crash that could occur if the Set SORTBY function was called with a column that wasn't currently displayed.
  • Drag & drop of attachments from Outlook to a folder tab now works correctly.
  • Fixed problem with slide-out back/forwards buttons where they would not notice the mouse was no longer over them if the mouse moved during the slide animation.
  • Fixed the Go command's OPENINDEST argument so that it will use an existing destination Lister if the current Lister is not a dual-display one.
  • If two or more files on an FTP site were selected and 'Open' chosen from the context menu, they would in some cases be downloaded and opened multiple times.
  • New FTP Proxy for USER: user@proxy_user@host and PASS: password@proxy_password.

24 September 2010

Quick View Plus and Opus

Quick View Plus (QVP) is a product which can view hundreds of file formats without the need for any additional software. For example, it can display Microsoft Word or Corel Word Perfect documents without having either program installed.

Quick View Plus 11 includes a preview handler that works within Directory Opus (and newer versions of Windows Explorer and Outlook).

Simply installing Quick View Plus 11 Standard (or above) will add its viewing abilities to Directory Opus if you are on Windows Vista, Windows 7 or above.

Notes & Caveats (correct at the time of writing, September 2010):

  • Windows XP: Quick View Plus 11 does not install its preview handler on Windows XP, although it may do if you have Outlook 2007 installed (this has not been tested).
  • 64-bit: Avantstar, who make Quick View Plus, do not officially support using it on 64-bit versions of Windows; however, from brief testing it appears to work fine.
  • QVP editions: Quick View Plus 11 comes in two editions: Standard and Professional. The Standard edition is all you need if you just wish to view files within Directory Opus.
  • QVP Trial version: The current Quick View Plus trial version does not correctly install its preview handler, meaning it will not work within Directory Opus. Avantstar are aware and will hopefully fix this in the future. The problem does not affect the full version of Quick View Plus. You can still use the trial version's standalone QVP application to test how well it views certain files.


(Thanks to Michael Kenward, Jon Potter and Avantstar themselves for their help discovering the info above. Thanks also to Ron Hirsch whose quest for a way to view Word Perfect files in 64-bit Opus led us here.)

8 September 2010

Directory Opus version 9.5.5.1 (Beta)

This is an Opus Beta release only. If you aren't comfortable running the very latest version of Opus then you may like to wait for the next stable/public release.

To download the new beta version, visit the Directory Opus 9.5.5.1 thread.

Bugs fixed / minor changes:

  • Fix for the 'Open in Directory Opus' folder context menu item not working in Windows 7 if Explorer Replacement mode was disabled in some cases. This also fixes the 'Open folder to view files in Directory Opus' AutoPlay option if Explorer Replacement mode disabled.
  • Fixed crash when using the Print Folder command without any printers installed (or with print service disabled).
  • Fixed problem that prevented custom Folder Colors from working reliably in the tree.
  • Fix for FTP sites that claim to support UTF-8 but return non-UTF-8 encoded directory listings.

27 August 2010

Directory Opus version 9.5.5.0

Directory Opus version 9.5.5.0 - August 27th 2010

A free update for all registered Directory Opus 9 users is now available for download from GP Software.

Direct Downloads:
Directory Opus x86 (32 bit)
Directory Opus x64 (64 bit)

Bugs fixed / minor changes:

  • Fixed dialog font issue on Japanese systems.
  • Fix for bug on x64 systems that could prevent the Smart Favorites being saved correctly if Opus was still running on system shutdown.
  • Fixed inconsistent sorting of network drives in the Folder Tree.
  • Fix for TGA plugin being too strict and failing to display some images.
  • Fixed occasional crash in the Preferences Filter page.
  • Fix for 'Open With' not setting the correct current directory when used on a network drive.
  • FTP – Fixed issue with supporting Resume for servers that fail FEAT response.

28 July 2010

How to change the language Opus uses

For other FAQs, go to the Opus Resource Centre FAQ list.


Below are three alternative ways to change the language of your Directory Opus installation.

The second and third methods involve running commands. Those commands can be pasted into the Start -> Run box (Windows XP) or into the Start Menu search field (Windows Vista and above) or into a command prompt (any Windows version).

Obviously, if you have installed Opus to a non-standard location then you will need to adjust the commands to match.

  1. Via Preferences (the usual, simple way)

    In Opus, go to Settings -> Preferences / Display / Language and select another language from the list.

    (In older versions of Opus, it was under Miscellaneous rather than Display.)

    Of course, doing that may be difficult if Opus is running in a language you do not understand. :-) However, don't worry:
    • You can type >Prefs into the main Opus window to open the Preferences window, in case you cannot work out what the menus say.

    • As of Opus 10.0.3.2, you can type the name of your language (or any of the supported languages, for that matter) into the filter at the bottom-left of the Preferences window and Opus will automatically find the languages page for you.

    If those easy methods don't do it for you, here are some alternatives...

  2. Command to open Preferences

    Jump directly to the Language page of Preferences by running this command:

    "C:\Program Files\GPSoftware\Directory Opus\dopusrt.exe" /cmd Prefs PAGE=Language
  3. Command to change language

    Alternatively, you can tell Opus to switch to a specific language via the command line.

    Before doing this you must fully exit Opus. (Closing all the windows isn't enough, by default. See How to Exit Directory Opus.)

    After exiting, run this command:

    "C:\Program Files\GPSoftware\Directory Opus\dopus.exe" language=english
    Go to C:\Program Files\GPSoftware\Directory Opus\Language to see which languages/names are available. (Do not include the .dll part of the filenames.)

3 June 2010

Directory Opus version 9.5.4.0

Directory Opus version 9.5.4.0 - June 3rd 2010

A free update for all registered Directory Opus 9 users is now available for download from GP Software.

Bugs fixed / minor changes:

  • Added move_netshare_semantics advanced Preferences option to work around a problem moving folders caused by PGP Netshare.
  • Added support for transparent (alpha-channel) TIFF images (both 8-bit and 16-bit images).
  • Added tiff_assume_alpha advanced Preferences flag to force alpha on TIFF images which have a 4th channel but don't specify its meaning.
  • Fixed a crash that could occur if you dragged a file over a sub-folder on an ftp site, and hovered there while a copy to that same site was in progress.
  • Fixed a problem when trying to inline-rename a file or folder whose original name contained an environment variable.
  • Fixed a problem with the @set command directive that would stop {dlgstring} working correctly with {file} as the default value unless prefixed with @runonce.
  • The timestamp of a file with NTFS ADS properties is now correctly preserved when the file is copied.
  • ActiveX: Prevents the Syntax-Colored Source preview handler from handling .url files by default. If that handler is installed the plugin will still send .url files to a web browser unless explicitly configured not to.
  • Fixed a problem that could cause a crash when editing the defined filter in the Print Folder dialog.
  • Fixed a problem that caused the Folder Tree to fail to expand the Desktop branch with a particular combination of settings.
  • The FILTER argument for the Print FOLDER command now works correctly.
  • If two or more single file-display Listers were open, the Go DUALPATH command used to cause the folder in the destination Lister to change, instead of setting the source Lister into dual-display mode.
  • Improved support for the Recorded TV start menu link in Windows 7.
  • The Rename command could not move files when the source folder was a file collection.
  • If a rename script fails, the rename operation is now aborted.

21 May 2010

Directory Opus version 9.5.3.2 (Beta)

This is an Opus Beta release only. If you aren't comfortable running the very latest version of Opus then you may like to wait for the next stable/public release.

To download the new beta version, visit the Directory Opus 9.5.3.2 thread.

Bugs fixed / minor changes:

  • Added move_netshare_semantics advanced Preferences option to work around a problem moving folders caused by PGP Netshare.
  • Fixed a problem when trying to inline-rename a file or folder whose original name contains an environment variable.
  • Fixed a problem with the @set command directive that would stop {dlgstring} working correctly with {file} as the default value unless prefixed with @runonce.
  • The timestamp of a file with NTFS ADS properties is now correctly preserved when the file is copied.
  • ActiveX: Prevents the Syntax-Colored Source preview handler from handling .url files by default. If that handler is installed the plugin will still send .url files to a web browser unless explicitly configured not to.
  • Now supports alpha channels from 16-bit TIFF images.
  • Added tiff_assume_alpha advanced Preferences flag to force alpha on TIFF images which have a 4th channel but don't specify its meaning.

30 April 2010

Directory Opus version 9.5.3.1 (Beta)

This is an Opus Beta release only. If you aren't comfortable running the very latest version of Opus then you may like to wait for the next stable/public release.

To download the new beta version, visit the Directory Opus 9.5.3.1 thread.

Bugs fixed / minor changes:

  • Fixed a problem that could cause a crash when editing the defined filter in the Print Folder dialog.
  • Fixed a problem that caused the Folder Tree to fail to expand the Desktop branch with a particular combination of settings.
  • The FILTER argument for the Print FOLDER command now works correctly.
  • If two or more single file-display Listers were open, the Go DUALPATH command used to cause the folder in the destination Lister to change, instead of setting the source Lister into dual-display mode.
  • Improved support for the Recorded TV start menu link in Windows 7
  • The Rename command could not move files when the source folder was a file collection.
  • If a rename script fails, the rename operation is now aborted.
  • Added support for transparent (alpha-channel) TIFF images.

27 April 2010

Sort music files and go to the target folder

(I usually forget to post things like this to the blog, so apologies for that.)

I've written a new post in the Opus Rename Scripting forum which demonstrates a few things that may be useful. (The actual button in the post is unlikely to be useful to you as-is but the techniques it uses could come in handy.)


The main/new thing is moving some files (based on their MP3 tags, in this case) and then using a little VBScript to feed their new path into other commands (to make Opus show their new location, in this case).

It's fairly advanced stuff, as Opus scripting goes, so don't worry if you can't understand it. Hope some people find it useful.

18 March 2010

Updated: Interactive list of Opus Plugins & Media Capabilities

The Interactive list of Opus Plugins & Media Capabilities has been updated so that it is easier to find out if and how Opus can be used to view different types of files.

The list is now split into more categories and now includes several preview handlers and ActiveX controls which work within Opus, in addition to all the native Opus plugins and built-in features.



(The screenshot above is of the old version, just for illustration.)

Syntax coloured source-code viewer

Programmers who wish to view source code with syntax colouring should check out this preview handler:

http://www.smartftp.com/client/addons/sourcepreview

(This discovery is thanks to spiralx at the Opus forums.)

The preview handler was written for SmartFTP and Windows Explorer but it works great in Directory Opus as well. Just install it and you're done.

It works with both 32-bit and 64-bit, unlike the old Source Code Viewer Plugin.



Supported extensions/types:

  • ActionScript (.as, .mx)
  • ASP (.asp)
  • ASPX (.aspx)
  • AutoIt (.au3)
  • Bash (.sh, .bsh)
  • Batch (.bat, .cmd)
  • Caml (.ml, .mli, .sml, .thy)
  • C (.c)
  • C++ (.cpp, .cxx, .cc, .h, .hxx, .rgs)
  • C# (.cs)
  • CSS (.css)
  • Diff (.diff, .patch)
  • Fortran (.f, .for, .f90, .f95, .f2k)
  • Ini (.ini, .inf, .reg, .url)
  • Inno Setup (.iss)
  • Java (.java)
  • JavaScript (.js)
  • Lisp (.lsp, .lisp)
  • Makefile (.mak)
  • Matlab (.m)
  • NFO (.nfo)
  • NSIS (.nsi, .nsh)
  • Pascal (.pas, .inc)
  • Perl (.pl, .pm, .plx)
  • PHP (.php, .php3, .phtml)
  • Python (.py, .pyw)
  • Resource (.rc)
  • Smalltalk (.st)
  • TeX (.tex)
  • SQL (.sql)
  • VB (.vb)
  • VBScript (.vbs)
  • XML (.xml, .xsd, .xsml, xsl, .kml)
(Not all of the types above are assigned to it by default. To change them in Opus, use go to Settings -> Preferences / Plugins / Viewers: ActiveX + Preview + Office + Web and click Configure, then find Source in the list of preview handlers and modify the list of extensions.)

17 March 2010

Directory Opus version 9.5.3.0

Directory Opus version 9.5.3.0 - March 17th 2010

A free update for all registered Directory Opus 9 users is now available for download from GP Software.

Bugs fixed / minor changes:

  • Fixed a problem that could cause the folder tree to refresh unnecessarily and which sometimes caused folder changes in the file display.
  • Fixed a problem with the Automatically calculate folder sizes option not working if the relative size on disk column was also enabled. Also fixed errors in calculating relative size on disk bar graph in some situations.
  • Fixed a problem that could prevent a search from completing when searching certain malformed UTF-8 files.
  • Improved support for the Folder Sharing context menu on Windows 7.
  • Fixed a problem with SFTP where connecting to one site when already connected to another site could try to login with the wrong password.
  • Fix for crash when using the Set as Desktop Wallpaper context menu item in Windows 7.
  • Fix for crash when using the Rename command with "%20" in the command parameters.
  • Fixed problem with using the file display border Open this folder in the other side button when used with a folder tab called "root".
  • Fixed problem with identifying FTP sites that support Resume.
  • When Opus writes filenames to a DOS batch file (via a DOS batch-mode button), it now uses the codepage specified by the @codepage directive (if any) rather than the ANSI codepage.
  • The Delete command with the NORECYCLE and QUIET arguments no longer skips any remaining sub-folder contents if a file is unable to be deleted; it will continue and delete any files within the sub-folder that it can.
  • Fixed a problem that could occasionally prevent the folder tree from expanding to display the source folder when a lister is first opened.

26 February 2010

Directory Opus version 9.5.2.5 (Beta)

This is an Opus Beta release only. If you aren't comfortable running the very latest version of Opus then you may like to wait for the next stable/public release.

To download the new beta version, visit the Directory Opus 9.5.2.5 thread.

Bugs fixed / minor changes:

  • Fixed a problem that could cause the tree to refresh unnecessarily, which occasionally would cause a folder change in the Lister.
  • Fixed a problem with the Automatically calculate folder sizes option not working if the relative size on disk column was also enabled. Also fixed errors in calculating relative size on disk bar graph in some situations.
  • Fixed a problem that could prevent a search from completing when searching certain malformed UTF-8 files.
  • Improved support for the Folder Sharing context menu on Windows 7.
  • Fixed a problem with SFTP where connecting to one site when already connected to another site could try to login with the wrong password.
  • Fix for crash when using the Set as Desktop Wallpaper context menu item in Windows 7.
  • Fix for crash when using the Rename command with "%20" in the command parameters.
  • Fixed problem with using the file display border Open this folder in the other side button when used with a folder tab called "root".

20 January 2010

Why NOT to run Opus as Admin in Vista / Windows 7

A new FAQ has been posted at the Resource Centre.

Summary

If you have UAC enabled then it is not a good idea to run Directory Opus as administrator (i.e. "elevated") in Vista / Windows 7. You should run it at the standard level and instead use Opus's UAC support to elevate as required.

(If you have UAC turned off then this is not an issue. Opus works fine running as administrator if the rest of your desktop is also running as administrator, as is the case with UAC turned off and on earlier versions of Windows. Opus works just as well with UAC as without it. Problems will occur if Opus is running at a higher elevation level than the rest of your desktop.)

Detail

...Continue reading the full FAQ.

18 January 2010

Fix for problems viewing My Computer

Update 2: If you're using Opus 10 or later, ignore this entirely. Changes were made to the way the data is stored to avoid the problem.

Update: It doesn't look like the problem was due to 32-bit/64-bit config import, but something else... The advice still stands, though: If you find My Computer or another system folder to be very slow in Opus, delete your system.off file as described below.

Original post:

Two people who imported their Opus config from 32-bit to 64-bit machines have experienced problems when viewing system/virtual folders such as My Computer.

This doesn't seem to be a widespread problem but it's obviously a pain if it hits you.

Here's the fix in case you need it:

1. Go to /dopusdata\Formats (via the Opus location field).

2. Delete system.off.

(This is also worth trying if you have problems with My Computer and similar folders in general. It resets the way those folders are displayed within Opus back to their defaults.)

(Forum thread.)

7 January 2010

Directory Opus version 9.5.2.0

Directory Opus version 9.5.2.0 - January 7th 2010

A free update for all Directory Opus 9 users is now available for download from GP Software.

Note for non-English users: The initial release was lacking translations but they have been added now.

Bugs fixed / minor changes:

  • Fixed a problem introduced in the previous version that could cause a crash when the content type system was activated.
  • Improved file date comparison in synchronize (particularly with the Ignore seconds option enabled)
  • Improved support for display of 256x256 .ICO files
  • Single locked tabs are now respected in the Default Lister or layouts (previously the lock state would be lost unless multiple tabs were configured)
  • Numeric sorting rules are now applied to custom fields so fields like the Tortoise SVN Revision field will sort correctly
  • Fixed scrollbar calculation problem in List mode that could result in weird behaviour depending on the size of the Lister
  • Fixed problem with {allfile} command sequence when filename contains multiple periods
  • Fixed support for PowerArchiver drag&drop menu
  • Fix for duplicate entries appearing in the Open With menu in some situations
  • Fix for buffer overflow in Raw plugin's config dialog
  • Fixed problem that could cause slow copy speeds to removable disks
  • Added support for additional file extensions to the CD jewel case thumbnail rendering (added .oga, .fla, .wv, .m4a, .m4p, .ape and .mpc)