RFR: 8353444: NMT: rename 'category' to 'MemTag' in malloc tracker [v5]

Gerard Ziemski gziemski at openjdk.org
Tue Aug 12 15:10:20 UTC 2025


On Fri, 8 Aug 2025 12:55:42 GMT, Afshin Zafari <azafari at openjdk.org> wrote:

>> Renamed usage of 'category' for 'MemTag' cases.
>
> Afshin Zafari has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision:
> 
>  - Merge remote-tracking branch 'origin/master' into _8353444_mem_category_to_memtag
>  - copyright fixed
>  - Merge remote-tracking branch 'origin/master' into _8353444_mem_category_to_memtag
>  - fixed a missed test.
>  - user-facing terms remained as 'category'
>  - 8353444: NMT: rename 'category' to 'MemTag' in malloc tracker

Changes requested by gziemski (Reviewer).

src/hotspot/share/nmt/mallocLimit.hpp line 57:

> 55: 
> 56:   void set_global_limit(size_t s, MallocLimitMode type);
> 57:   void set_mem_tag_limit(MemTag mem_tag, size_t s, MallocLimitMode mode);

Prefer the old names.

src/hotspot/share/nmt/mallocTracker.cpp line 131:

> 129: }
> 130: 
> 131: bool MallocMemorySummary::mem_tag_limit_reached(MemTag mem_tag, size_t s, size_t so_far, const malloclimit* limit) {

I think I prefer the old name of this API.

src/hotspot/share/nmt/mallocTracker.hpp line 216:

> 214:   // Called when a total limit break was detected.
> 215:   // Will return true if the limit was handled, false if it was ignored.
> 216:   static bool mem_tag_limit_reached(MemTag mem_tag, size_t s, size_t so_far, const malloclimit* limit);

I think I prefer the old name of this API.

src/hotspot/share/nmt/mallocTracker.hpp line 258:

> 256: 
> 257:   // MallocLimit: returns true if allocating s bytes on f would trigger
> 258:   // either global or the MemTag limit

No need to change the comment?

src/hotspot/share/nmt/mallocTracker.inline.hpp line 34:

> 32: #include "utilities/globalDefinitions.hpp"
> 33: 
> 34: // Returns true if allocating s bytes on f would trigger either global or the MemTag limit

No need to change the comment?

test/hotspot/gtest/nmt/test_nmt_malloclimit.cpp line 79:

> 77: }
> 78: 
> 79: TEST(NMT, MallocLimitPerMemTag) {

Prefer the old name.

test/hotspot/gtest/nmt/test_nmt_totals.cpp line 92:

> 90:     // spread over mem-tags
> 91:     int mtag = i % (mt_number_of_tags - 1);
> 92:     p[i] = NEW_C_HEAP_ARRAY(char, ALLOC_SIZE, (MemTag)mtag);

Prefer the old names.

-------------

PR Review: https://git.openjdk.org/jdk/pull/25226#pullrequestreview-3111280820
PR Review Comment: https://git.openjdk.org/jdk/pull/25226#discussion_r2270208623
PR Review Comment: https://git.openjdk.org/jdk/pull/25226#discussion_r2270197022
PR Review Comment: https://git.openjdk.org/jdk/pull/25226#discussion_r2270198699
PR Review Comment: https://git.openjdk.org/jdk/pull/25226#discussion_r2270200770
PR Review Comment: https://git.openjdk.org/jdk/pull/25226#discussion_r2270201911
PR Review Comment: https://git.openjdk.org/jdk/pull/25226#discussion_r2270204431
PR Review Comment: https://git.openjdk.org/jdk/pull/25226#discussion_r2270206418


More information about the hotspot-runtime-dev mailing list