src/hotspot/os/solaris/perfMemory_solaris.cpp
branchdatagramsocketimpl-branch
changeset 58678 9cf78a70fa4f
parent 51106 f605c91e5219
child 58679 9c3209ff7550
equal deleted inserted replaced
58677:13588c901957 58678:9cf78a70fa4f
     1 /*
     1 /*
     2  * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   589         if (statbuf.st_size > 0 && statbuf.st_ctime > oldest_ctime) {
   589         if (statbuf.st_size > 0 && statbuf.st_ctime > oldest_ctime) {
   590 
   590 
   591           if (statbuf.st_ctime > oldest_ctime) {
   591           if (statbuf.st_ctime > oldest_ctime) {
   592             char* user = strchr(dentry->d_name, '_') + 1;
   592             char* user = strchr(dentry->d_name, '_') + 1;
   593 
   593 
   594             if (oldest_user != NULL) FREE_C_HEAP_ARRAY(char, oldest_user);
   594             FREE_C_HEAP_ARRAY(char, oldest_user);
   595             oldest_user = NEW_C_HEAP_ARRAY(char, strlen(user)+1, mtInternal);
   595             oldest_user = NEW_C_HEAP_ARRAY(char, strlen(user)+1, mtInternal);
   596 
   596 
   597             strcpy(oldest_user, user);
   597             strcpy(oldest_user, user);
   598             oldest_ctime = statbuf.st_ctime;
   598             oldest_ctime = statbuf.st_ctime;
   599           }
   599           }
  1053                 "Could not determine PerfMemory size");
  1053                 "Could not determine PerfMemory size");
  1054   }
  1054   }
  1055 
  1055 
  1056   if ((statbuf.st_size == 0) ||
  1056   if ((statbuf.st_size == 0) ||
  1057      ((size_t)statbuf.st_size % os::vm_page_size() != 0)) {
  1057      ((size_t)statbuf.st_size % os::vm_page_size() != 0)) {
  1058     THROW_MSG_0(vmSymbols::java_lang_Exception(),
  1058     THROW_MSG_0(vmSymbols::java_io_IOException(),
  1059                 "Invalid PerfMemory size");
  1059                 "Invalid PerfMemory size");
  1060   }
  1060   }
  1061 
  1061 
  1062   return (size_t)statbuf.st_size;
  1062   return (size_t)statbuf.st_size;
  1063 }
  1063 }