src/share/vm/services/heapDumper.cpp

changeset 1481
72a6752ac432
parent 1063
7bb995fbd3c0
child 1577
4ce7240d622c
     1.1 --- a/src/share/vm/services/heapDumper.cpp	Tue Oct 27 02:42:24 2009 -0700
     1.2 +++ b/src/share/vm/services/heapDumper.cpp	Wed Oct 28 11:16:42 2009 -0700
     1.3 @@ -1913,8 +1913,9 @@
     1.4      if (use_default_filename) {
     1.5        char fn[32];
     1.6        sprintf(fn, "java_pid%d", os::current_process_id());
     1.7 -      assert(strlen(base_path) + strlen(fn) < sizeof(base_path), "HeapDumpPath too long");
     1.8 +      assert(strlen(base_path) + strlen(fn) + strlen(".hprof") < sizeof(base_path), "HeapDumpPath too long");
     1.9        strcat(base_path, fn);
    1.10 +      strcat(base_path, ".hprof");
    1.11      }
    1.12      assert(strlen(base_path) < sizeof(my_path), "Buffer too small");
    1.13      strcpy(my_path, base_path);
    1.14 @@ -1927,8 +1928,6 @@
    1.15      strcat(my_path, fn);
    1.16    }
    1.17    dump_file_seq++;   // increment seq number for next time we dump
    1.18 -  assert(strlen(".hprof") + strlen(my_path) < sizeof(my_path), "HeapDumpPath too long");
    1.19 -  strcat(my_path, ".hprof");
    1.20  
    1.21    HeapDumper dumper(false /* no GC before heap dump */,
    1.22                      true  /* send to tty */);

mercurial