Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

hsperfdata_<USER> dirctories

843829Jul 6 2006 — edited Oct 24 2006
From googling the net and searching these forums I understand the JVM needs to create the hsperfdata files. I can live with that I guess. My problem is that the JVM always creates them in /tmp on my SuSE Enterprise 9 server. I need to be able to specify the location of these files. I tried setting environment variables, TMP and TEMP. That did not work. I tried a -Djava.io.tmpdir=/mydir and that did not work.

I went to the JVM source and found in perfMemory_linux.cpp:

static char* get_user_tmp_dir(const char* user) {

const char* tmpdir = os::get_temp_directory();
const char* perfdir = PERFDATA_NAME;
size_t nbytes = strlen(tmpdir) + strlen(perfdir) + strlen(user) + 2;
char* dirname = NEW_C_HEAP_ARRAY(char, nbytes);

// construct the path name to user specific tmp directory
snprintf(dirname, nbytes, "%s%s_%s", tmpdir, perfdir, user);

return dirname;
}

I then tracked down this get_temp_directory function and found this in os_linux.cpp:

const char* os::get_temp_directory() { return "/tmp/"; }

So this means the JVM is hard coded to access /tmp. There is no reason the JVM should be hardcoded to such a location, it should be customizable through some sort of parameter. Anyone have ideas?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 21 2006
Added on Jul 6 2006
6 comments
4,258 views