Title: Very high memory usage when running under sudo in Linux · Issue #180 · DiamondLightSource/pythonSoftIOC · GitHub
Open Graph Title: Very high memory usage when running under sudo in Linux · Issue #180 · DiamondLightSource/pythonSoftIOC
X Title: Very high memory usage when running under sudo in Linux · Issue #180 · DiamondLightSource/pythonSoftIOC
Description: Hi all, It seems that creating and initializing an IOC takes up a crazy high amount of memory when ran under sudo. This is not the case when ran as user. Here is a minimal example to demonstrate: import psutil from softioc import softioc...
Open Graph Description: Hi all, It seems that creating and initializing an IOC takes up a crazy high amount of memory when ran under sudo. This is not the case when ran as user. Here is a minimal example to demonstrate: i...
X Description: Hi all, It seems that creating and initializing an IOC takes up a crazy high amount of memory when ran under sudo. This is not the case when ran as user. Here is a minimal example to demonstrate: i...
Opengraph URL: https://github.com/DiamondLightSource/pythonSoftIOC/issues/180
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Very high memory usage when running under sudo in Linux","articleBody":"Hi all,\n\nIt seems that creating and initializing an IOC takes up a crazy high amount of memory when ran under sudo. This is not the case when ran as user. Here is a minimal example to demonstrate:\n\n```python\nimport psutil\nfrom softioc import softioc, builder, asyncio_dispatcher\n\ndef print_memory_usage(loc: str):\n print(f\"{loc:32s}: {psutil.Process().memory_info().rss:,}\")\n\nprint_memory_usage(\"Before PV\")\npv = builder.longOut(\"myVariable\")\n\nprint_memory_usage(\"Before loadDatabase\")\nbuilder.LoadDatabase()\n\nprint_memory_usage(\"Before dispatcher\")\ndispatcher = asyncio_dispatcher.AsyncioDispatcher()\nprint_memory_usage(\"Before iocInit\")\nsoftioc.iocInit(dispatcher)\n\nprint_memory_usage(\"Before start\")\nsoftioc.interactive_ioc()\n```\n\nOutput when ran as user:\n```\nINFO: PVXS QSRV2 is loaded, permitted, and ENABLED.\n2025-01-16T13:55:56.327190606 WARN pvxs.tcp.setup Server unable to bind port 5075, falling back to [::]:37275\nBefore PV : 85,139,456\nBefore loadDatabase : 85,139,456\nBefore dispatcher : 85,139,456\nBefore iocInit : 87,236,608\nStarting iocInit\n############################################################################\n## EPICS 7.0.7.1-DEV\n## Rev. 7.0.7.99.1.1\n## Rev. Date 7.0.7.99.1.1\n############################################################################\ncas WARNING: Configured TCP port was unavailable.\ncas WARNING: Using dynamically assigned TCP port 43649,\ncas WARNING: but now two or more servers share the same UDP port.\ncas WARNING: Depending on your IP kernel this server may not be\ncas WARNING: reachable with UDP unicast (a host's IP in EPICS_CA_ADDR_LIST)\niocRun: All initialization complete\nBefore start : 89,600,000\nPython 3.12.3 (main, Nov 6 2024, 18:32:19) [GCC 13.2.0] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n(InteractiveConsole)\n>>>\n```\n\nOutput when ran as sudo:\n```\nINFO: PVXS QSRV2 is loaded, permitted, and ENABLED.\n2025-01-16T13:56:32.146488207 WARN pvxs.tcp.setup Server unable to bind port 5075, falling back to [::]:39775\nBefore PV : 85,114,880\nBefore loadDatabase : 85,114,880\nBefore dispatcher : 85,114,880\nBefore iocInit : 87,212,032\nStarting iocInit\n############################################################################\n## EPICS 7.0.7.1-DEV\n## Rev. 7.0.7.99.1.1\n## Rev. Date 7.0.7.99.1.1\n############################################################################\ncas WARNING: Configured TCP port was unavailable.\ncas WARNING: Using dynamically assigned TCP port 37929,\ncas WARNING: but now two or more servers share the same UDP port.\ncas WARNING: Depending on your IP kernel this server may not be\ncas WARNING: reachable with UDP unicast (a host's IP in EPICS_CA_ADDR_LIST)\niocRun: All initialization complete\nBefore start : 950,546,432\nPython 3.12.3 (main, Nov 6 2024, 18:32:19) [GCC 13.2.0] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n(InteractiveConsole)\n>>>\n```\n\nAs you can see, the issue seems to happen in `softioc.iocInit`. Packages used to test (on Ubuntu):\n```\nsoftioc 4.5.0\npsutil 6.1.1\n```\n\nThis issue occurs both on Ubuntu and NixOS.","author":{"url":"https://github.com/DenSinH","@type":"Person","name":"DenSinH"},"datePublished":"2025-01-16T12:58:46Z","url":"https://github.com/DiamondLightSource/pythonSoftIOC/issues/180"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b6fdb793-1e81-dd0a-e658-8899a42e3167 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C856:3CDF0:37C5E0:4B6EE1:6B04371E |
| html-safe-nonce | b6ddd6306f989fadb0bcb390da300dfc63fd8e1e0655de16336003f7b3c486ca |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDODU2OjNDREYwOjM3QzVFMDo0QjZFRTE6NkIwNDM3MUUiLCJ2aXNpdG9yX2lkIjoiNjU3NTQ2MDcwOTk0ODQ3MTA3MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f45d53624e9ebe111d25656202f51929348c9dcd52a1a14c780b67ffb693f5cc |
| hovercard-subject-tag | issue:2792686720 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/DiamondLightSource/pythonSoftIOC/180/issue_layout |
| twitter:image | https://opengraph.githubassets.com/80ccbb659ba69eff8202950936c8741c802fe7a6f51db1c0de8a33c7346a28a0/DiamondLightSource/pythonSoftIOC/issues/180 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/80ccbb659ba69eff8202950936c8741c802fe7a6f51db1c0de8a33c7346a28a0/DiamondLightSource/pythonSoftIOC/issues/180 |
| og:image:alt | Hi all, It seems that creating and initializing an IOC takes up a crazy high amount of memory when ran under sudo. This is not the case when ran as user. Here is a minimal example to demonstrate: i... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | DenSinH |
| hostname | github.com |
| expected-hostname | github.com |
| None | b7a1d2b9101496921b08579fbee988d014345aef2f5bd660d1f8c7332d81560e |
| turbo-cache-control | no-preview |
| go-import | github.com/DiamondLightSource/pythonSoftIOC git https://github.com/DiamondLightSource/pythonSoftIOC.git |
| octolytics-dimension-user_id | 1233618 |
| octolytics-dimension-user_login | DiamondLightSource |
| octolytics-dimension-repository_id | 20049394 |
| octolytics-dimension-repository_nwo | DiamondLightSource/pythonSoftIOC |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20049394 |
| octolytics-dimension-repository_network_root_nwo | DiamondLightSource/pythonSoftIOC |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | c3dd496c3da6ea6b77e69c09279d2b81604654f1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width