Bug 297599 - Allow index files to go in a separate directory
Summary: Allow index files to go in a separate directory
Status: CLOSED MOVED
Alias: None
Product: MAT
Classification: Tools
Component: Core (show other bugs)
Version: 0.8   Edit
Hardware: PC Windows XP
: P3 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-11 11:33 EST by Andrew Johnson CLA
Modified: 2024-05-08 12:49 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Johnson CLA 2009-12-11 11:33:01 EST
I've had some requests for the index files for Memory Analyzer to go in a separate directory.

Some possibilities:

1. A directory based on my dump file. E.g. 
  /u/user1/mydump.20091001.dmp.zip
  /u/user1/mydump.20091001.dmp.indexes/mydump.20091001.dmp.index
/u/user1/mydump.20091001.dmp.indexes/mydump.20091001.dmp.o2c.index

2. A directory in the same directory as the dump
  /u/user1/mydump.20091001.dmp.zip
  /u/user1/.metadata/mydump.20091001.dmp.index
  /u/user1/.metadata/mydump.20091001.dmp.o2c.index

  /u/user1/dmp2/mydump.20090808.dmp.zip
  /u/user1/dmp2/.metadata/mydump.20090808.dmp.index
  /u/user1/dmp2/.metadata/mydump.20090808.dmp.o2c.index

3. Another specified directory
  /u/user1/mydump.20091001.dmp.zip
  /tmp/tempindexes/mydump.20091001.dmp.index
  /tmp/tempindexes/mydump.20091001.dmp.o2c.index

How would we specify this while not breaking existing behaviour but still allowing batch and GUI modes to use other directories when required?
Comment 1 Krum Tsvetkov CLA 2009-12-15 06:23:25 EST
I think we need to keep the current behaviour as default. There are many people already who are used to it.
We could look for a way to specify an alternative behaviour. But what bothers me at the moment is the scope of this setting, namely:

* Shall we specify for it globally for the tool? 
* Or shall one specify this per heap dump? 

In both cases we will have to find where the indexes of an already parsed with a different setting heapdump are?
Having an absolute path (e.g. option 3) will make it impossible (or say it more difficult) to move the dump from one place to another.

Have you got some ideas about these already?
Comment 2 Andrew Johnson CLA 2013-03-05 09:06:05 EST
Another idea is to use an Eclipse workspace which has a folder with a link to the dump, but the indices get stored directly in the folder in the workspace.

/u/user1/workspace/folder/mydump.20091001.dmp.zip -> /u/user1/mydump.20091001.dmp.zip
/u/user1/workspace/folder/mydump.20091001.dmp.index
Comment 3 Krum Tsvetkov CLA 2013-03-11 03:48:59 EDT
(In reply to comment #2)
> Another idea is to use an Eclipse workspace which has a folder with a link
> to the dump, but the indices get stored directly in the folder in the
> workspace.

/u/user1/workspace/folder/mydump.20091001.dmp.zip ->
> /u/user1/mydump.20091001.dmp.zip
> /u/user1/workspace/folder/mydump.20091001.dmp.index

Does this work on Win too? I played with manually creating a shortcut in a folder, but the indeces always go in the original folder...
Sorry if I've misunderstood the idea.
Comment 4 Andrew Johnson CLA 2013-03-11 09:53:22 EDT
Your are right, currently the indices do get stored in the original folder, but I was offering a suggestion for a change.

We would need to generate a prefix from the IFile not the IPath.
It could be tricky to pass the prefix into the parser:
SnapshotFactory.openSnapshot(File file, Map<String, String> arguments, IProgressListener listener)
which is called from ParseHeapDumpJob or ParseSnapshotApp
Comment 5 Andrew Johnson CLA 2013-11-08 07:36:42 EST
task 380858 allows separate indices for different snapshots in one dump.
This might allow us to find the original dump from the index if the index is held elsewhere.
Comment 6 Eclipse Webmaster CLA 2024-05-08 12:49:30 EDT
This issue has been migrated to https://github.com/eclipse-mat/org.eclipse.mat/issues/6.