Title: [BUG] Memory accumulation when using load_image in a loop · Issue #365 · arrayfire/arrayfire-rust · GitHub
Open Graph Title: [BUG] Memory accumulation when using load_image in a loop · Issue #365 · arrayfire/arrayfire-rust
X Title: [BUG] Memory accumulation when using load_image in a loop · Issue #365 · arrayfire/arrayfire-rust
Description: The following program crashed. But why? use arrayfire::*; fn main() { let mut y =constant!(0 as u8;1); for i in 0..1000 { let x = load_image::
Open Graph Description: The following program crashed. But why? use arrayfire::*; fn main() { let mut y =constant!(0 as u8;1); for i in 0..1000 { let x = load_image::
X Description: The following program crashed. But why? use arrayfire::*; fn main() { let mut y =constant!(0 as u8;1); for i in 0..1000 { let x = load_image::<u8>("2dzs/robot_2dz.png".to_string(), ...
Opengraph URL: https://github.com/arrayfire/arrayfire-rust/issues/365
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[BUG] Memory accumulation when using load_image in a loop","articleBody":"The following program crashed. But why?\r\n\r\n```\r\nuse arrayfire::*;\r\n\r\nfn main() {\r\n let mut y =constant!(0 as u8;1);\r\n for i in 0..1000 {\r\n let x = load_image::\u003cu8\u003e(\"2dzs/robot_2dz.png\".to_string(), true);\r\n let z = or(\u0026x, \u0026y, true);\r\n y = z.copy();\r\n println!(\"i={}\", i);\r\n }\r\n println!(\"max(y)={:#?}\", max_all(\u0026y));\r\n}\r\n\r\n```\r\n\r\n```\r\ni=0\r\ni=1\r\ni=2\r\ni=3\r\ni=4\r\ni=5\r\ni=6\r\ni=7\r\ni=8\r\ni=9\r\ni=10\r\ni=11\r\ni=12\r\ni=13\r\ni=14\r\ni=15\r\ni=16\r\ni=17\r\ni=18\r\ni=19\r\ni=20\r\ni=21\r\ni=22\r\ni=23\r\ni=24\r\ni=25\r\ni=26\r\ni=27\r\ni=28\r\ni=29\r\ni=30\r\ni=31\r\ni=32\r\ni=33\r\ni=34\r\ni=35\r\ni=36\r\ni=37\r\ni=38\r\ni=39\r\ni=40\r\ni=41\r\ni=42\r\ni=43\r\ni=44\r\ni=45\r\ni=46\r\ni=47\r\ni=48\r\ni=49\r\ni=50\r\ni=51\r\nthread 'main' panicked at 'Error message: System or Device ran out of memory\r\nLast error: In function af_load_image\r\nIn file src/api/c/imageio.cpp:393\r\n\r\n\r\n 0# 0x00007F4FC1A299AF in /opt/arrayfire/lib/libafcuda.so.3\r\n 1# 0x0000560F6F590AFF in target/debug/crash\r\n 2# 0x0000560F6F590099 in target/debug/crash\r\n 3# 0x0000560F6F5903AB in target/debug/crash\r\n 4# 0x0000560F6F59031E in target/debug/crash\r\n 5# 0x0000560F6F58FC41 in target/debug/crash\r\n 6# 0x0000560F6F5A707F in target/debug/crash\r\n 7# 0x0000560F6F58FC10 in target/debug/crash\r\n 8# 0x0000560F6F5902EC in target/debug/crash\r\n 9# 0x00007F4FFB823510 in /lib/x86_64-linux-gnu/libc.so.6\r\n10# __libc_start_main in /lib/x86_64-linux-gnu/libc.so.6\r\n11# 0x0000560F6F58FB15 in target/debug/crash\r\n', /home/joe/.cargo/registry/src/mirrors.ustc.edu.cn-12df342d903acd47/arrayfire-3.8.0/src/core/error.rs:37:14\r\nstack backtrace:\r\n 0: rust_begin_unwind\r\n at /rustc/c07a8b4e09f356c7468b69c50cac7fc5b5000b8a/library/std/src/panicking.rs:584:5\r\n 1: core::panicking::panic_fmt\r\n at /rustc/c07a8b4e09f356c7468b69c50cac7fc5b5000b8a/library/core/src/panicking.rs:142:14\r\n 2: arrayfire::core::error::handle_error_general\r\n at /home/joe/.cargo/registry/src/mirrors.ustc.edu.cn-12df342d903acd47/arrayfire-3.8.0/src/core/error.rs:37:14\r\n 3: arrayfire::core::error::Callback::call\r\n at /home/joe/.cargo/registry/src/mirrors.ustc.edu.cn-12df342d903acd47/arrayfire-3.8.0/src/core/error.rs:29:9\r\n 4: arrayfire::core::error::HANDLE_ERROR\r\n at /home/joe/.cargo/registry/src/mirrors.ustc.edu.cn-12df342d903acd47/arrayfire-3.8.0/src/core/error.rs:95:5\r\n 5: arrayfire::image::load_image\r\n at /home/joe/.cargo/registry/src/mirrors.ustc.edu.cn-12df342d903acd47/arrayfire-3.8.0/src/image/mod.rs:317:9\r\n 6: crash::main\r\n at ./src/main.rs:6:17\r\n 7: core::ops::function::FnOnce::call_once\r\n at /rustc/c07a8b4e09f356c7468b69c50cac7fc5b5000b8a/library/core/src/ops/function.rs:248:5\r\nnote: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.\r\n```\r\n","author":{"url":"https://github.com/3togo","@type":"Person","name":"3togo"},"datePublished":"2022-11-09T16:05:57.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/365/arrayfire-rust/issues/365"}
| 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:e90d8724-4422-f566-eaa8-dab869ce80d3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CAA4:A0330:7C69:98C4:696E473D |
| html-safe-nonce | 7cbd138eb2fa11a5759ab54934712f66d0035cf1d3dff060f05cf24bf4a88995 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQUE0OkEwMzMwOjdDNjk6OThDNDo2OTZFNDczRCIsInZpc2l0b3JfaWQiOiI2NDYwODMwMTMzMDMwNjM1MzI1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | a43c2ed728b38aab4f504e46ccc9eb6038adaaec84c3d8512abe95c9d66810a9 |
| hovercard-subject-tag | issue:1442359809 |
| 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/arrayfire/arrayfire-rust/365/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2fee0b5ab144a00bcf5a5e9a0948f8fb5e8f1947c853b392002c381845afea78/arrayfire/arrayfire-rust/issues/365 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2fee0b5ab144a00bcf5a5e9a0948f8fb5e8f1947c853b392002c381845afea78/arrayfire/arrayfire-rust/issues/365 |
| og:image:alt | The following program crashed. But why? use arrayfire::*; fn main() { let mut y =constant!(0 as u8;1); for i in 0..1000 { let x = load_image:: |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | 3togo |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3d96554e55b469c47dbcd31f74dc86278872b170531e84c6ce7f3389673e01d1 |
| turbo-cache-control | no-preview |
| go-import | github.com/arrayfire/arrayfire-rust git https://github.com/arrayfire/arrayfire-rust.git |
| octolytics-dimension-user_id | 5395442 |
| octolytics-dimension-user_login | arrayfire |
| octolytics-dimension-repository_id | 35817370 |
| octolytics-dimension-repository_nwo | arrayfire/arrayfire-rust |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 35817370 |
| octolytics-dimension-repository_network_root_nwo | arrayfire/arrayfire-rust |
| 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 | ef576694863a4c791d0a5cc9d2b84384d4414bcd |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width