René's URL Explorer Experiment


Title: LittleEndianByteBufAllocator uses UnpooledByteBufAllocator is not optimal and potentially causing OOM error · Issue #435 · jasync-sql/jasync-sql · GitHub

Open Graph Title: LittleEndianByteBufAllocator uses UnpooledByteBufAllocator is not optimal and potentially causing OOM error · Issue #435 · jasync-sql/jasync-sql

X Title: LittleEndianByteBufAllocator uses UnpooledByteBufAllocator is not optimal and potentially causing OOM error · Issue #435 · jasync-sql/jasync-sql

Description: MySQLConnectionHandler uses the default LittleEndianByteBufAllocator for netty this.bootstrap.option(ChannelOption.ALLOCATOR, LittleEndianByteBufAllocator.INSTANCE) LittleEndianByteBufAllocator uses UnpooledByteBufAllocator as default cl...

Open Graph Description: MySQLConnectionHandler uses the default LittleEndianByteBufAllocator for netty this.bootstrap.option(ChannelOption.ALLOCATOR, LittleEndianByteBufAllocator.INSTANCE) LittleEndianByteBufAllocator use...

X Description: MySQLConnectionHandler uses the default LittleEndianByteBufAllocator for netty this.bootstrap.option(ChannelOption.ALLOCATOR, LittleEndianByteBufAllocator.INSTANCE) LittleEndianByteBufAllocator use...

Opengraph URL: https://github.com/jasync-sql/jasync-sql/issues/435

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"LittleEndianByteBufAllocator uses UnpooledByteBufAllocator is not optimal and potentially causing OOM error","articleBody":"MySQLConnectionHandler uses the default LittleEndianByteBufAllocator for netty\n`this.bootstrap.option(ChannelOption.ALLOCATOR, LittleEndianByteBufAllocator.INSTANCE)`\n\nLittleEndianByteBufAllocator uses UnpooledByteBufAllocator as default\n```\nclass LittleEndianByteBufAllocator(private val allocator: UnpooledByteBufAllocator = UnpooledByteBufAllocator(false)) :\n    ByteBufAllocator by allocator {\n\n    companion object {\n        val INSTANCE = LittleEndianByteBufAllocator()\n    }\n```\n\nI guess the jasync-sql team want to use heap memory instead of direct memory here.\n\nHowever, on the netty side, netty's SSLHandler will choose to use direct memory or not by himself\n\nio.netty.handler.ssl.SSLHandler\n```\n    private ByteBuf allocate(ChannelHandlerContext ctx, int capacity) {\n        ByteBufAllocator alloc = ctx.alloc();\n        if (engineType.wantsDirectBuffer) {\n            return alloc.directBuffer(capacity);\n        } else {\n            return alloc.buffer(capacity);\n        }\n    }\n```\n\nAnd unfortunately, in some cases, like when using tcnative libaray, netty will choose to use directBuffer explicitly. This is not efficient to allocate and de-allocate directly using unpooled allocator. And also, using Unpooled direct memory sometimes causing OutOfMemory error because large amount of direct memory has already got pooled by netty.\n\n```\n\u003cmysql-connection-35\u003e Transport failure  (mysql.MySQLConnection:)\njava.lang.OutOfMemoryError: Cannot reserve 4110 bytes of direct buffer memory (allocated: 134217321, limit: 134217728)\n\tat java.base/java.nio.Bits.reserveMemory(Unknown Source) ~[?:?]\n\tat java.base/java.nio.DirectByteBuffer.\u003cinit\u003e(Unknown Source) ~[?:?]\n\tat java.base/java.nio.ByteBuffer.allocateDirect(Unknown Source) ~[?:?]\n\tat io.netty.util.internal.CleanerJava9.allocate(CleanerJava9.java:86) ~[netty-common-4.2.3.Final.jar!/:4.2.3.Final]\n\tat io.netty.util.internal.PlatformDependent.allocateDirect(PlatformDependent.java:567) ~[netty-common-4.2.3.Final.jar!/:4.2.3.Final]\n\tat io.netty.buffer.UnpooledDirectByteBuf.allocateDirectBuffer(UnpooledDirectByteBuf.java:121) ~[netty-buffer-4.2.3.Final.jar!/:4.2.3.Final]\n\tat io.netty.buffer.UnpooledByteBufAllocator$InstrumentedUnpooledUnsafeDirectByteBuf.allocateDirectBuffer(UnpooledByteBufAllocator.java:207) ~[netty-buffer-4.2.3.Final.jar!/:4.2.3.Final]\n\tat io.netty.buffer.UnpooledDirectByteBuf.\u003cinit\u003e(UnpooledDirectByteBuf.java:66) ~[netty-buffer-4.2.3.Final.jar!/:4.2.3.Final]\n\tat io.netty.buffer.UnpooledUnsafeDirectByteBuf.\u003cinit\u003e(UnpooledUnsafeDirectByteBuf.java:42) ~[netty-buffer-4.2.3.Final.jar!/:4.2.3.Final]\n\tat io.netty.buffer.UnpooledByteBufAllocator$InstrumentedUnpooledUnsafeDirectByteBuf.\u003cinit\u003e(UnpooledByteBufAllocator.java:202) ~[netty-buffer-4.2.3.Final.jar!/:4.2.3.Final]\n\tat io.netty.buffer.UnpooledByteBufAllocator.newDirectBuffer(UnpooledByteBufAllocator.java:93) ~[netty-buffer-4.2.3.Final.jar!/:4.2.3.Final]\n\tat io.netty.buffer.AbstractByteBufAllocator.directBuffer(AbstractByteBufAllocator.java:188) ~[netty-buffer-4.2.3.Final.jar!/:4.2.3.Final]\n\tat io.netty.buffer.AbstractByteBufAllocator.directBuffer(AbstractByteBufAllocator.java:179) ~[netty-buffer-4.2.3.Final.jar!/:4.2.3.Final]\n\tat com.github.jasync.sql.db.mysql.codec.LittleEndianByteBufAllocator.directBuffer(LittleEndianByteBufAllocator.kt:43) ~[jasync-mysql-2.2.4.jar!/:?]\n\tat io.netty.handler.ssl.SslHandler.allocate(SslHandler.java:2442) ~[netty-handler-4.2.3.Final.jar!/:4.2.3.Final]\n\tat io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1502) ~[netty-handler-4.2.3.Final.jar!/:4.2.3.Final]\n\tat io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1398) ~[netty-handler-4.2.3.Final.jar!/:4.2.3.Final]\n\tat io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1449) ~[netty-handler-4.2.3.Final.jar!/:4.2.3.Final]\n\tat io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:530) ~[netty-codec-base-4.2.3.Final.jar!/:4.2.3.Final]\n\tat io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:469) ~[netty-codec-base-4.2.3.Final.jar!/:4.2.3.Final]\n\tat io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290) ~[netty-codec-base-4.2.3.Final.jar!/:4.2.3.Final]\n\tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:356) ~[netty-transport-4.2.3.Final.jar!/:4.2.3.Final]\n\tat io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1429) ~[netty-transport-4.2.3.Final.jar!/:4.2.3.Final]\n\tat io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:918) ~[netty-transport-4.2.3.Final.jar!/:4.2.3.Final]\n\tat io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:167) ~[netty-transport-4.2.3.Final.jar!/:4.2.3.Final]\n\tat io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.handle(AbstractNioChannel.java:445) ~[netty-transport-4.2.3.Final.jar!/:4.2.3.Final]\n\tat io.netty.channel.nio.NioIoHandler$DefaultNioRegistration.handle(NioIoHandler.java:381) ~[netty-transport-4.2.3.Final.jar!/:4.2.3.Final]\n\tat io.netty.channel.nio.NioIoHandler.processSelectedKey(NioIoHandler.java:575) ~[netty-transport-4.2.3.Final.jar!/:4.2.3.Final]\n\tat io.netty.channel.nio.NioIoHandler.processSelectedKeysOptimized(NioIoHandler.java:550) ~[netty-transport-4.2.3.Final.jar!/:4.2.3.Final]\n\tat io.netty.channel.nio.NioIoHandler.processSelectedKeys(NioIoHandler.java:491) ~[netty-transport-4.2.3.Final.jar!/:4.2.3.Final]\n\tat io.netty.channel.nio.NioIoHandler.run(NioIoHandler.java:468) ~[netty-transport-4.2.3.Final.jar!/:4.2.3.Final]\n\tat io.netty.channel.SingleThreadIoEventLoop.runIo(SingleThreadIoEventLoop.java:207) ~[netty-transport-4.2.3.Final.jar!/:4.2.3.Final]\n\tat io.netty.channel.SingleThreadIoEventLoop.run(SingleThreadIoEventLoop.java:178) ~[netty-transport-4.2.3.Final.jar!/:4.2.3.Final]\n\tat io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:1073) ~[netty-common-4.2.3.Final.jar!/:4.2.3.Final]\n\tat io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.2.3.Final.jar!/:4.2.3.Final]\n\tat java.base/java.lang.Thread.run(Unknown Source) [?:?]\n```\n\nSo, I would like to suggest to use PooledByteBufAllocator for LittleEndianByteBufAllocator. Or at least make it configurable.\nThanks!\n\nMy environment:\nLinux\n```\n\u003cdependency\u003e\n\t\t\t\u003cgroupId\u003eio.netty\u003c/groupId\u003e\n\t\t\t\u003cartifactId\u003enetty-tcnative-boringssl-static\u003c/artifactId\u003e\n\t\t\t\u003cversion\u003e2.0.72.Final\u003c/version\u003e\n\t\t\u003c/dependency\u003e\n\n\u003cdependency\u003e\n\t\t\t\u003cgroupId\u003eio.netty\u003c/groupId\u003e\n\t\t\t\u003cartifactId\u003enetty-handler\u003c/artifactId\u003e\n\t\t\t\u003cversion\u003e4.2.3.Final\u003c/version\u003e\n\t\t\u003c/dependency\u003e\n\n\u003cdependency\u003e\n\t\t\t\u003cgroupId\u003ecom.github.jasync-sql\u003c/groupId\u003e\n\t\t\t\u003cartifactId\u003ejasync-r2dbc-mysql\u003c/artifactId\u003e\n\t\t\t\u003cversion\u003e2.2.4\u003c/version\u003e\n\t\t\u003c/dependency\u003e\n```","author":{"url":"https://github.com/knucle-infinity","@type":"Person","name":"knucle-infinity"},"datePublished":"2025-10-17T03:40:14.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/435/jasync-sql/issues/435"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:1f89c9d0-344b-148f-0fda-2e5d5a3b9819
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idAF0A:2B131:823552:A4E09A:697E59BD
html-safe-noncefe1a6d0b3fc962c5d1bdc6f024c210181e98e26c3b90145262df6f48c87920d4
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRjBBOjJCMTMxOjgyMzU1MjpBNEUwOUE6Njk3RTU5QkQiLCJ2aXNpdG9yX2lkIjoiNDA4NTk0NjM3MzY4NzQ0MzgxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac217b1c961faa80fbf2b104dae73f07919bc9b1557af4203272b5517dd1e2c15e
hovercard-subject-tagissue:3524344678
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/jasync-sql/jasync-sql/435/issue_layout
twitter:imagehttps://opengraph.githubassets.com/fa209a02147ac647a3df6e092b6d8d35b59fe3df3d215c16e8beefa5c4538ff3/jasync-sql/jasync-sql/issues/435
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/fa209a02147ac647a3df6e092b6d8d35b59fe3df3d215c16e8beefa5c4538ff3/jasync-sql/jasync-sql/issues/435
og:image:altMySQLConnectionHandler uses the default LittleEndianByteBufAllocator for netty this.bootstrap.option(ChannelOption.ALLOCATOR, LittleEndianByteBufAllocator.INSTANCE) LittleEndianByteBufAllocator use...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameknucle-infinity
hostnamegithub.com
expected-hostnamegithub.com
None60279d4097367e16897439d16d6bbe4180663db828c666eeed2656988ffe59f6
turbo-cache-controlno-preview
go-importgithub.com/jasync-sql/jasync-sql git https://github.com/jasync-sql/jasync-sql.git
octolytics-dimension-user_id42655245
octolytics-dimension-user_loginjasync-sql
octolytics-dimension-repository_id145898133
octolytics-dimension-repository_nwojasync-sql/jasync-sql
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id145898133
octolytics-dimension-repository_network_root_nwojasync-sql/jasync-sql
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
release7c85641c598ad130c74f7bcc27f58575cac69551
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/jasync-sql/jasync-sql/issues/435#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fjasync-sql%2Fjasync-sql%2Fissues%2F435
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
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
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://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/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fjasync-sql%2Fjasync-sql%2Fissues%2F435
Sign up https://patch-diff.githubusercontent.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=jasync-sql%2Fjasync-sql
Reloadhttps://patch-diff.githubusercontent.com/jasync-sql/jasync-sql/issues/435
Reloadhttps://patch-diff.githubusercontent.com/jasync-sql/jasync-sql/issues/435
Reloadhttps://patch-diff.githubusercontent.com/jasync-sql/jasync-sql/issues/435
jasync-sql https://patch-diff.githubusercontent.com/jasync-sql
jasync-sqlhttps://patch-diff.githubusercontent.com/jasync-sql/jasync-sql
Please reload this pagehttps://patch-diff.githubusercontent.com/jasync-sql/jasync-sql/issues/435
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Fjasync-sql%2Fjasync-sql
Fork 139 https://patch-diff.githubusercontent.com/login?return_to=%2Fjasync-sql%2Fjasync-sql
Star 1.7k https://patch-diff.githubusercontent.com/login?return_to=%2Fjasync-sql%2Fjasync-sql
Code https://patch-diff.githubusercontent.com/jasync-sql/jasync-sql
Issues 15 https://patch-diff.githubusercontent.com/jasync-sql/jasync-sql/issues
Pull requests 2 https://patch-diff.githubusercontent.com/jasync-sql/jasync-sql/pulls
Discussions https://patch-diff.githubusercontent.com/jasync-sql/jasync-sql/discussions
Actions https://patch-diff.githubusercontent.com/jasync-sql/jasync-sql/actions
Wiki https://patch-diff.githubusercontent.com/jasync-sql/jasync-sql/wiki
Security 0 https://patch-diff.githubusercontent.com/jasync-sql/jasync-sql/security
Insights https://patch-diff.githubusercontent.com/jasync-sql/jasync-sql/pulse
Code https://patch-diff.githubusercontent.com/jasync-sql/jasync-sql
Issues https://patch-diff.githubusercontent.com/jasync-sql/jasync-sql/issues
Pull requests https://patch-diff.githubusercontent.com/jasync-sql/jasync-sql/pulls
Discussions https://patch-diff.githubusercontent.com/jasync-sql/jasync-sql/discussions
Actions https://patch-diff.githubusercontent.com/jasync-sql/jasync-sql/actions
Wiki https://patch-diff.githubusercontent.com/jasync-sql/jasync-sql/wiki
Security https://patch-diff.githubusercontent.com/jasync-sql/jasync-sql/security
Insights https://patch-diff.githubusercontent.com/jasync-sql/jasync-sql/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/jasync-sql/jasync-sql/issues/435
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/jasync-sql/jasync-sql/issues/435
LittleEndianByteBufAllocator uses UnpooledByteBufAllocator is not optimal and potentially causing OOM errorhttps://patch-diff.githubusercontent.com/jasync-sql/jasync-sql/issues/435#top
https://github.com/knucle-infinity
https://github.com/knucle-infinity
knucle-infinityhttps://github.com/knucle-infinity
on Oct 17, 2025https://github.com/jasync-sql/jasync-sql/issues/435#issue-3524344678
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.