spring-cloud / spring-cloud/spring-cloud-commons

Spring Boot 2.6.14 + Spring Cloud Context 3.1.5 fullgc

Open
#1,204 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

waiting-for-triage
Dominant language
Java
Stars
751
Forks
744
Avg merge
1d 14h
Merged PRs (30d)
9

Description

Spring Boot 2.6.14
Nacos 2.1.1
Spring Cloud Context 3.1.5

Use Environment#getProperty to get the configuration center object. Generates a large number of LinkedHashSet objects. Cause the jvm to be full gc.

The code in BootstrapPropertySource is as follows:

@Override
	public String[] getPropertyNames() {
		Set<String> names = new LinkedHashSet<>();
		names.addAll(Arrays.asList(this.delegate.getPropertyNames()));

		return StringUtils.toStringArray(names);
	}

The Environment#getProperty method is used inside the for loop.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at BootstrapPropertySource#getPropertyNames and trace the Environment#getProperty calls described in the issue's loop. Reproduce with the listed Spring Boot, Nacos, and Spring Cloud Context versions while monitoring allocation and full GC; done means the reported repeated LinkedHashSet allocation and resulting full GC are addressed.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring, spring-boot
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.