RFR: 8203925: tools/javac/importscope/T8193717.java ran out of java heap [v2]

Guoxiong Li github.com+13688759+lgxbslgx at openjdk.java.net
Thu Apr 15 02:57:47 UTC 2021


On Thu, 15 Apr 2021 01:42:06 GMT, Guoxiong Li <github.com+13688759+lgxbslgx at openjdk.org> wrote:

>> Hi all,
>> 
>> Because [JDK-8225054-PATCH](https://github.com/openjdk/jdk/commit/827e5e32264666639d36990edd5e7d0b7e7c78a9) modified `T8193717.java`, changing `private static final int CLASSES = 500000;` to `private static final int CLASSES = 50000;`(500K -> 50K). The error, `out of java heap`, no longer occurs now. And the pre-submit tests of this patch passed. I think `tools/javac/importscope/T8193717.java` could be removed from `ProblemList.txt`.
>> 
>> Thank you for taking the time to review.
>> 
>> Best Regards.
>
> Guoxiong Li 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 two additional commits since the last revision:
> 
>  - Merge branch 'master' into JDK-8203925
>  - 8203925: tools/javac/importscope/T8193717.java ran out of java heap

@vicente-romero-oracle Thank you for your comment. When the number of the `import` statements increases, the `JCImport` tree and other objects in `javac` would increase, too.(In other words, the memory would be gradually used, too) There is no doubt that `out of heap` would occur if the number of the `import` statements becomes so large.

---
I read the original issue [JDK-8193717](https://bugs.openjdk.java.net/browse/JDK-8193717) and found the original number should be 50k instead of 500k. The quote is shown below. We can consider that the 500k is the wrong value.
> Compiling a generated file with about 50 thousand imports

And then, [JDK-8225054-PATCH](https://github.com/openjdk/jdk/commit/827e5e32264666639d36990edd5e7d0b7e7c78a9) fixed it(500k -> 50k). The [JDK-8225054-PATCH](https://github.com/openjdk/jdk/commit/827e5e32264666639d36990edd5e7d0b7e7c78a9) is a big feature(Compiler implementation for records) and some details may be omitted. I think that the authors of the patch forgot to remove `tools/javac/importscope/T8193717.java` from the `ProblemList` when they fixed the bug(500k -> 50k).

---
I merged the master branch code just now to restart the `Pre-submit test`. If the test `tools/javac/importscope/T8193717.java` passes at the `Pre-submit test`, I think it is good to remove it from the `ProblemList`.

What's your opinion? Maybe the authors of the [JDK-8225054-PATCH](https://github.com/openjdk/jdk/commit/827e5e32264666639d36990edd5e7d0b7e7c78a9) could give more information. Any idea is appreciated.

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

PR: https://git.openjdk.java.net/jdk/pull/1998


More information about the compiler-dev mailing list