René's URL Explorer Experiment


Title: Reduce memory consumption when repeatedly calling WritableJson.toByteArray · Issue #49428 · spring-projects/spring-boot · GitHub

Open Graph Title: Reduce memory consumption when repeatedly calling WritableJson.toByteArray · Issue #49428 · spring-projects/spring-boot

X Title: Reduce memory consumption when repeatedly calling WritableJson.toByteArray · Issue #49428 · spring-projects/spring-boot

Description: Enhancement request Hi, we are using LogstashStructuredLogFormatter in our projects and it has affected the performance because the garbage collector is running a lot. After analyzing the allocated memory we have detected that the Writab...

Open Graph Description: Enhancement request Hi, we are using LogstashStructuredLogFormatter in our projects and it has affected the performance because the garbage collector is running a lot. After analyzing the allocated...

X Description: Enhancement request Hi, we are using LogstashStructuredLogFormatter in our projects and it has affected the performance because the garbage collector is running a lot. After analyzing the allocated...

Opengraph URL: https://github.com/spring-projects/spring-boot/issues/49428

X: @github

direct link

Domain: redirect.github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Reduce memory consumption when repeatedly calling WritableJson.toByteArray","articleBody":"**Enhancement request**\nHi, we are using `LogstashStructuredLogFormatter` in our projects and it has affected the performance because the garbage collector is running a lot. After analyzing the allocated memory we have detected that the `WritableJson.toByteArray` method is the one to blame.\n\nAs far as I can see, you are using 2 buffers in memory for the same thing:\n\n```java\ndefault byte[] toByteArray(Charset charset) {\n\tAssert.notNull(charset, \"'charset' must not be null\");\n\ttry (ByteArrayOutputStream out = new ByteArrayOutputStream()) {\n\t\ttoWriter(new OutputStreamWriter(out, charset));\n\t\treturn out.toByteArray();\n\t}\n\tcatch (IOException ex) {\n\t\tthrow new UncheckedIOException(ex);\n\t}\n}\n```\nThe 2 buffers are:\n1) `ByteArrayOutputStream` buffer.\n2) `OutputStreamWriter.se.bb` (a `ByteBuffer` inside the `StreamEncoder` inside the `OutputStreamWriter`)\n\nDo you think that you could use \"toJsonString().getBytes()\"? Or maybe use some kind of `org.springframework.core.io.buffer.DataBuffer` implementation?\n\nAlso, when you compare `WritableJson` with Jackson `ObjectMapper`, you see that the `ObjectMapper` includes a \"BufferRecycler\" to reduce the number of times that the garbage collection has to run.\n\nDo you think that you could use something similar?\n\nThanks!","author":{"url":"https://github.com/System25","@type":"Person","name":"System25"},"datePublished":"2026-03-05T12:40:13Z","url":"https://github.com/spring-projects/spring-boot/issues/49428"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:f54fc209-be6c-3ec2-7f55-68ea1a692562
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idCF92:1F05C8:1E3ED74:27C7242:6AEDA112
html-safe-noncebf55adca653dec0801c201ca85f7333dac50cfb937a6ec425cd75e04b507fe4c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRjkyOjFGMDVDODoxRTNFRDc0OjI3QzcyNDI6NkFFREExMTIiLCJ2aXNpdG9yX2lkIjoiNDcwOTQ5MTUzOTQ3MTg2ODE3OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacf08b8313e6e788b28ac3530ad3ecc2420e903099fb8899c359de9762638dcdd4
hovercard-subject-tagissue:4027983447
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/spring-projects/spring-boot/49428/issue_layout
twitter:imagehttps://opengraph.githubassets.com/62aab182013078ebb6affcc06838e5a0b3dd72991c5b3cc135177af34d06393d/spring-projects/spring-boot/issues/49428
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/62aab182013078ebb6affcc06838e5a0b3dd72991c5b3cc135177af34d06393d/spring-projects/spring-boot/issues/49428
og:image:altEnhancement request Hi, we are using LogstashStructuredLogFormatter in our projects and it has affected the performance because the garbage collector is running a lot. After analyzing the allocated...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameSystem25
hostnamegithub.com
expected-hostnamegithub.com
None9f51e3b6c7a190e426e641ae15acbc58dd1ac2003e96b58879bbc298e213dbf3
turbo-cache-controlno-preview
go-importgithub.com/spring-projects/spring-boot git https://github.com/spring-projects/spring-boot.git
octolytics-dimension-user_id317776
octolytics-dimension-user_loginspring-projects
octolytics-dimension-repository_id6296790
octolytics-dimension-repository_nwospring-projects/spring-boot
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id6296790
octolytics-dimension-repository_network_root_nwospring-projects/spring-boot
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release7060660810b587033ea861b8aa67beb72c8e6542
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://redirect.github.com/spring-projects/spring-boot/issues/49428#start-of-content
https://redirect.github.com/
Sign inhttps://redirect.github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fspring-projects%2Fspring-boot%2Fissues%2F49428
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://redirect.github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fspring-projects%2Fspring-boot%2Fissues%2F49428
Sign uphttps://redirect.github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=spring-projects%2Fspring-boot
Reloadhttps://redirect.github.com/spring-projects/spring-boot/issues/49428
Reloadhttps://redirect.github.com/spring-projects/spring-boot/issues/49428
Reloadhttps://redirect.github.com/spring-projects/spring-boot/issues/49428
spring-projectshttps://redirect.github.com/spring-projects
spring-boothttps://redirect.github.com/spring-projects/spring-boot
Codehttps://redirect.github.com/spring-projects/spring-boot
Issues443 (443)https://redirect.github.com/spring-projects/spring-boot/issues
Pull requests37 (37)https://redirect.github.com/spring-projects/spring-boot/pulls
Actionshttps://redirect.github.com/spring-projects/spring-boot/actions
Wikihttps://redirect.github.com/spring-projects/spring-boot/wiki
Security and qualityhttps://redirect.github.com/spring-projects/spring-boot/security
Insightshttps://redirect.github.com/spring-projects/spring-boot/pulse
https://redirect.github.com/spring-projects/spring-boot
New issuehttps://redirect.github.com/login?return_to=https://github.com/spring-projects/spring-boot/issues/49428
New issuehttps://redirect.github.com/login?return_to=https://github.com/spring-projects/spring-boot/issues/49428
Reduce memory consumption when repeatedly calling WritableJson.toByteArrayhttps://redirect.github.com/spring-projects/spring-boot/issues/49428#top
https://redirect.github.com/philwebb
type: enhancementA general enhancementhttps://github.com/spring-projects/spring-boot/issues?q=state%3Aopen%20label%3A%22type%3A%20enhancement%22
4.1.0https://github.com/spring-projects/spring-boot/milestone/413
https://github.com/System25
System25https://github.com/System25
on Mar 5, 2026https://github.com/spring-projects/spring-boot/issues/49428#issue-4027983447
spring-projects-issueshttps://redirect.github.com/spring-projects-issues
status: waiting-for-triageAn issue that has not yet been triaged. Contributions will not be accepted.https://redirect.github.com/spring-projects/spring-boot/issues?q=state%3Aopen%20label%3A%22status%3A%20waiting-for-triage%22
on Mar 5, 2026https://github.com/spring-projects/spring-boot/issues/49428#event-23296405590
https://redirect.github.com/philwebb
philwebbhttps://redirect.github.com/philwebb
on Mar 6, 2026https://github.com/spring-projects/spring-boot/issues/49428#issuecomment-4012355726
@System25https://github.com/System25
philwebbhttps://redirect.github.com/philwebb
status: waiting-for-feedbackWe need additional information before we can continuehttps://redirect.github.com/spring-projects/spring-boot/issues?q=state%3Aopen%20label%3A%22status%3A%20waiting-for-feedback%22
on Mar 6, 2026https://github.com/spring-projects/spring-boot/issues/49428#event-23336141192
https://redirect.github.com/System25
System25https://redirect.github.com/System25
on Mar 6, 2026https://github.com/spring-projects/spring-boot/issues/49428#issuecomment-4014450664
spring-projects-issueshttps://redirect.github.com/spring-projects-issues
status: feedback-providedFeedback has been providedhttps://redirect.github.com/spring-projects/spring-boot/issues?q=state%3Aopen%20label%3A%22status%3A%20feedback-provided%22
status: waiting-for-feedbackWe need additional information before we can continuehttps://redirect.github.com/spring-projects/spring-boot/issues?q=state%3Aopen%20label%3A%22status%3A%20waiting-for-feedback%22
on Mar 6, 2026https://github.com/spring-projects/spring-boot/issues/49428#event-23346135485
philwebbhttps://redirect.github.com/philwebb
on Apr 29, 2026https://github.com/spring-projects/spring-boot/issues/49428#event-24974712852
philwebbhttps://redirect.github.com/philwebb
on Apr 30, 2026https://github.com/spring-projects/spring-boot/issues/49428#event-25047148640
philwebbhttps://redirect.github.com/philwebb
type: enhancementA general enhancementhttps://redirect.github.com/spring-projects/spring-boot/issues?q=state%3Aopen%20label%3A%22type%3A%20enhancement%22
status: waiting-for-triageAn issue that has not yet been triaged. Contributions will not be accepted.https://redirect.github.com/spring-projects/spring-boot/issues?q=state%3Aopen%20label%3A%22status%3A%20waiting-for-triage%22
status: feedback-providedFeedback has been providedhttps://redirect.github.com/spring-projects/spring-boot/issues?q=state%3Aopen%20label%3A%22status%3A%20feedback-provided%22
on Apr 30, 2026https://github.com/spring-projects/spring-boot/issues/49428#event-25047152197
philwebbhttps://redirect.github.com/philwebb
4.1.0https://github.com/spring-projects/spring-boot/milestone/413
on Apr 30, 2026https://github.com/spring-projects/spring-boot/issues/49428#event-25047164851
philwebbhttps://redirect.github.com/philwebb
completedhttps://redirect.github.com/spring-projects/spring-boot/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
2fffebehttps://github.com/spring-projects/spring-boot/commit/2fffebe214d249547bcd4828b66c9835100b9fcd
on Apr 30, 2026https://github.com/spring-projects/spring-boot/issues/49428#event-25053295834
https://redirect.github.com/philwebb
philwebbhttps://redirect.github.com/philwebb
on Apr 30, 2026https://github.com/spring-projects/spring-boot/issues/49428#issuecomment-4356240668
@System25https://github.com/System25
pullhttps://redirect.github.com/apps/pull
on Apr 30, 2026https://github.com/spring-projects/spring-boot/issues/49428#event-25053634227
Reduce garbage of repeated WritableJson.toByteArray() callshttps://github.com/Spencerx/spring-boot/commit/2fffebe214d249547bcd4828b66c9835100b9fcd
https://docs.github.com/articles/closing-issues-via-commit-messages
2fffebehttps://github.com/Spencerx/spring-boot/commit/2fffebe214d249547bcd4828b66c9835100b9fcd
Sign up for freehttps://redirect.github.com/signup?return_to=https://github.com/spring-projects/spring-boot/issues/49428
Sign in to commenthttps://redirect.github.com/login?return_to=https://github.com/spring-projects/spring-boot/issues/49428
philwebbhttps://redirect.github.com/philwebb
type: enhancementA general enhancementhttps://github.com/spring-projects/spring-boot/issues?q=state%3Aopen%20label%3A%22type%3A%20enhancement%22
4.1.0https://github.com/spring-projects/spring-boot/milestone/413
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.