René's URL Explorer Experiment


Title: Allocation of 360434219 exceeds 10% of free system memory. · Issue #588 · tensorflow/java · GitHub

Open Graph Title: Allocation of 360434219 exceeds 10% of free system memory. · Issue #588 · tensorflow/java

X Title: Allocation of 360434219 exceeds 10% of free system memory. · Issue #588 · tensorflow/java

Description: Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template System information Have I written custom code (a...

Open Graph Description: Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template System i...

X Description: Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template System i...

Opengraph URL: https://github.com/tensorflow/java/issues/588

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Allocation of 360434219 exceeds 10% of free system memory.","articleBody":"\u003cem\u003ePlease make sure that this is a bug. As per our [GitHub Policy](https://github.com/tensorflow/tensorflow/blob/master/ISSUES.md), we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template\u003c/em\u003e\r\n\r\n**System information**\r\n- Have I written custom code (as opposed to using a stock example script provided in TensorFlow):\r\n- OS Platform and Distribution (e.g., Linux Ubuntu 16.04 x86\\_64): **Linux x86_64 in a Docker cointainer**\r\n- TensorFlow installed from (source or binary):\r\n- TensorFlow version (use command below): **1.0.0-RC.2**\r\n- Java version (i.e., the output of `java -version`): **openjdk version \"21.0.4\"**\r\n- Java command line flags (e.g., GC parameters):\r\n- Python version (if transferring a model trained in Python): **3.9**\r\n- Bazel version (if compiling from source):\r\n- GCC/Compiler version (if compiling from source):\r\n- CUDA/cuDNN version:\r\n- GPU model and memory:\r\n\r\n**Describe the current behavior**\r\nI am using TensorFlow in a Spring Boot application, which exposes an endpoint for NER processing. The TensorFlow model is trained in Python and loaded into the Java application for inference.\r\n\r\nTo optimize performance, I initialize the TensorFlow session once during application startup using a @PostConstruct method and store it in a private field:\r\n\r\n```\r\nprivate Session session;\r\n\r\n@PostConstruct\r\nprivate void initialize() throws IOException {\r\n    byte[] bytes = Files.readAllBytes(Paths.get(\"/path/to/model/\"));\r\n    Graph graph = new Graph();\r\n    graph.importGraphDef(GraphDef.parseFrom(bytes), \"PREFIX\");\r\n    session = new Session(graph);\r\n}\r\n```\r\n\r\nThe session is reused in a public method for running predictions:\r\n\r\n```\r\npublic Result predict(String input) {\r\n    try (Tensor textTensor = Tensor.of(TINT32.class, ...);\r\n         Result result = session.runner()\r\n                                .feed(\"otherOperationName\", textTensor)\r\n                                .fetch(\"operationName\")\r\n                                .run()) {\r\n        // Process the result here\r\n    }\r\n}\r\n\r\n```\r\n\r\nDuring performance testing, I monitored the heap memory and found no significant issues. However, when the application runs in a Docker container, it crashes after a while, regardless of the memory allocated to the container (even with 120GB of memory). The following warning appears in the logs before the crash:\r\n\r\n`W external/local_tsl//framework/cpu_allocator_impl.cc:83] Allocation of 34891293 exceeds 10% of free system memory.`\r\n\r\nIs it possible that the memory leak is caused by the session being stored in a private field and never explicitly closed, even though all tensors and intermediate results are properly managed (closed) in the predict method?\r\n\r\n**Describe the expected behavior**\r\nThe application should not exhibit memory leaks or crashes when deployed in a Docker container, regardless of memory allocation.\r\n","author":{"url":"https://github.com/icrecescu","@type":"Person","name":"icrecescu"},"datePublished":"2024-11-25T06:25:47.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":12},"url":"https://github.com/588/java/issues/588"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:97b2fe10-40a6-f50c-d0ea-cd754771d9ce
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD6D2:CDF29:78B84:AAB3B:696A6523
html-safe-nonce7ac47bcfda2bf0c549abc55c307548699a2e472f6122d5397364230b6accbc92
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENkQyOkNERjI5Ojc4Qjg0OkFBQjNCOjY5NkE2NTIzIiwidmlzaXRvcl9pZCI6IjMwNzEzMDQ4OTQzNjI4MzgzMDciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacc830501a7cde94b325d81231704dfe3f9b9b6b51374b00b32c8cc6d623d5c47c
hovercard-subject-tagissue:2689346573
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/tensorflow/java/588/issue_layout
twitter:imagehttps://opengraph.githubassets.com/24633f16c5b98bd6b25a1414d18a8ed8be26f25541f48dd8fe27d1c114947a26/tensorflow/java/issues/588
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/24633f16c5b98bd6b25a1414d18a8ed8be26f25541f48dd8fe27d1c114947a26/tensorflow/java/issues/588
og:image:altPlease make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template System i...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameicrecescu
hostnamegithub.com
expected-hostnamegithub.com
None9b7735a184970dd9333b2cbe036c8f3c0a9108c64aaa93827c5a64fc70993392
turbo-cache-controlno-preview
go-importgithub.com/tensorflow/java git https://github.com/tensorflow/java.git
octolytics-dimension-user_id15658638
octolytics-dimension-user_logintensorflow
octolytics-dimension-repository_id207384523
octolytics-dimension-repository_nwotensorflow/java
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id207384523
octolytics-dimension-repository_network_root_nwotensorflow/java
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
release87cbd411c2982752221b5751d583a515b23bf5fa
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/tensorflow/java/issues/588#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftensorflow%2Fjava%2Fissues%2F588
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://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftensorflow%2Fjava%2Fissues%2F588
Sign up https://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=tensorflow%2Fjava
Reloadhttps://github.com/tensorflow/java/issues/588
Reloadhttps://github.com/tensorflow/java/issues/588
Reloadhttps://github.com/tensorflow/java/issues/588
tensorflow https://github.com/tensorflow
javahttps://github.com/tensorflow/java
Notifications https://github.com/login?return_to=%2Ftensorflow%2Fjava
Fork 223 https://github.com/login?return_to=%2Ftensorflow%2Fjava
Star 913 https://github.com/login?return_to=%2Ftensorflow%2Fjava
Code https://github.com/tensorflow/java
Issues 151 https://github.com/tensorflow/java/issues
Pull requests 23 https://github.com/tensorflow/java/pulls
Actions https://github.com/tensorflow/java/actions
Projects 0 https://github.com/tensorflow/java/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/tensorflow/java/security
Please reload this pagehttps://github.com/tensorflow/java/issues/588
Insights https://github.com/tensorflow/java/pulse
Code https://github.com/tensorflow/java
Issues https://github.com/tensorflow/java/issues
Pull requests https://github.com/tensorflow/java/pulls
Actions https://github.com/tensorflow/java/actions
Projects https://github.com/tensorflow/java/projects
Security https://github.com/tensorflow/java/security
Insights https://github.com/tensorflow/java/pulse
New issuehttps://github.com/login?return_to=https://github.com/tensorflow/java/issues/588
New issuehttps://github.com/login?return_to=https://github.com/tensorflow/java/issues/588
Allocation of 360434219 exceeds 10% of free system memory.https://github.com/tensorflow/java/issues/588#top
https://github.com/icrecescu
https://github.com/icrecescu
icrecescuhttps://github.com/icrecescu
on Nov 25, 2024https://github.com/tensorflow/java/issues/588#issue-2689346573
GitHub Policyhttps://github.com/tensorflow/tensorflow/blob/master/ISSUES.md
@PostConstructhttps://github.com/PostConstruct
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.