src/os/windows/vm/perfMemory_windows.cpp

changeset 7074
833b0f92429a
parent 5272
1f4355cee9a2
child 7535
7ae4e26cb1e0
child 9711
0f2fe7d37d8c
     1.1 --- a/src/os/windows/vm/perfMemory_windows.cpp	Wed Aug 27 09:36:55 2014 +0200
     1.2 +++ b/src/os/windows/vm/perfMemory_windows.cpp	Wed Aug 27 08:19:12 2014 -0400
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -1498,7 +1498,8 @@
    1.11    (void)memset(mapAddress, '\0', size);
    1.12  
    1.13    // it does not go through os api, the operation has to record from here
    1.14 -  MemTracker::record_virtual_memory_reserve((address)mapAddress, size, mtInternal, CURRENT_PC);
    1.15 +  MemTracker::record_virtual_memory_reserve_and_commit((address)mapAddress,
    1.16 +    size, CURRENT_PC, mtInternal);
    1.17  
    1.18    return (char*) mapAddress;
    1.19  }
    1.20 @@ -1680,7 +1681,8 @@
    1.21    }
    1.22  
    1.23    // it does not go through os api, the operation has to record from here
    1.24 -  MemTracker::record_virtual_memory_reserve((address)mapAddress, size, mtInternal, CURRENT_PC);
    1.25 +  MemTracker::record_virtual_memory_reserve_and_commit((address)mapAddress, size,
    1.26 +    CURRENT_PC, mtInternal);
    1.27  
    1.28  
    1.29    *addrp = (char*)mapAddress;
    1.30 @@ -1834,10 +1836,14 @@
    1.31      return;
    1.32    }
    1.33  
    1.34 -  MemTracker::Tracker tkr = MemTracker::get_virtual_memory_release_tracker();
    1.35 -  remove_file_mapping(addr);
    1.36 -  // it does not go through os api, the operation has to record from here
    1.37 -  tkr.record((address)addr, bytes);
    1.38 +  if (MemTracker::tracking_level() > NMT_minimal) {
    1.39 +    // it does not go through os api, the operation has to record from here
    1.40 +    Tracker tkr = MemTracker::get_virtual_memory_release_tracker();
    1.41 +    remove_file_mapping(addr);
    1.42 +    tkr.record((address)addr, bytes);
    1.43 +  } else {
    1.44 +    remove_file_mapping(addr);
    1.45 +  }
    1.46  }
    1.47  
    1.48  char* PerfMemory::backing_store_filename() {

mercurial