'Shinyapps.io application instance size set at 1GB, metrics show less than 300MB memory usage, but logs show out of memory message

I made a shiny app deployed on shinyapps.io that runs simulations (using the simmer package) under different scenarios/parameters. The application instance size is set at 1GB, and the logs show out of memory message.

However, shinyapps.io metrics show memory usage of less than 300MB, and I have also used profvis locally, which doesn't seem to show so much memory usage either (at least in difference between memory allocated and deallocated).

Any suggestions on what might be going wrong or where to look deeper are greatly appreciated!

Shinyapps.io memory metrics (the two spikes on March 13 specifically) show around 200MB or less memory usage.

Shinyapps.io application instance size set to 1GB.

Profvis results, the first line difference between memory allocation and deallocation is 770MB, the total difference over all lines is less than 100MB.

Shinyapps.io application logs:

2022-03-13T17:05:29.824733+00:00 shinyapps[5825051]: 
2022-03-13T17:05:29.824735+00:00 shinyapps[5825051]: Listening on http://127.0.0.1:45359
2022-03-13T17:05:35.839271+00:00 shinyapps[5825051]: Server version: 2022.02.0
2022-03-13T17:05:35.839299+00:00 shinyapps[5825051]: LANG: C.UTF-8
2022-03-13T17:05:35.834728+00:00 shinyapps[5825051]: Running on host: 72c8d467e770
2022-03-13T17:05:35.839352+00:00 shinyapps[5825051]: rmarkdown version: (none)
2022-03-13T17:05:35.839323+00:00 shinyapps[5825051]: shiny version: 1.7.1
2022-03-13T17:05:35.839330+00:00 shinyapps[5825051]: httpuv version: 1.6.5
2022-03-13T17:05:35.839364+00:00 shinyapps[5825051]: knitr version: (none)
2022-03-13T17:05:35.839307+00:00 shinyapps[5825051]: R version: 4.1.2
2022-03-13T17:05:35.839596+00:00 shinyapps[5825051]: Using pandoc: /opt/connect/ext/pandoc/2.16
2022-03-13T17:05:35.839365+00:00 shinyapps[5825051]: jsonlite version: 1.8.0
2022-03-13T17:05:35.839375+00:00 shinyapps[5825051]: RJSONIO version: (none)
2022-03-13T17:05:35.839397+00:00 shinyapps[5825051]: htmltools version: 0.5.2
2022-03-13T17:05:35.839425+00:00 shinyapps[5825051]: reticulate version: (none)
2022-03-13T17:05:36.159726+00:00 shinyapps[5825051]: Using jsonlite for JSON processing
2022-03-13T17:05:36.163635+00:00 shinyapps[5825051]: Shiny application starting ...
2022-03-13T17:05:36.163209+00:00 shinyapps[5825051]: 
2022-03-13T17:05:36.163210+00:00 shinyapps[5825051]: Starting R with process ID: '43'
2022-03-13T17:05:36.249769+00:00 shinyapps[5825051]: 
2022-03-13T17:05:36.250366+00:00 shinyapps[5825051]: 
2022-03-13T17:05:36.249771+00:00 shinyapps[5825051]: Attaching package: ‘DT’
2022-03-13T17:05:36.348938+00:00 shinyapps[5825051]: 
2022-03-13T17:05:36.250365+00:00 shinyapps[5825051]: The following objects are masked from ‘package:shiny’:
2022-03-13T17:05:36.348939+00:00 shinyapps[5825051]: 
2022-03-13T17:05:36.249771+00:00 shinyapps[5825051]: 
2022-03-13T17:05:36.348938+00:00 shinyapps[5825051]:     page
2022-03-13T17:05:36.348937+00:00 shinyapps[5825051]: The following object is masked from ‘package:utils’:
2022-03-13T17:05:36.348668+00:00 shinyapps[5825051]: Attaching package: ‘bslib’
2022-03-13T17:05:36.348669+00:00 shinyapps[5825051]: 
2022-03-13T17:05:36.348667+00:00 shinyapps[5825051]: 
2022-03-13T17:05:36.250366+00:00 shinyapps[5825051]:     dataTableOutput, renderDataTable
2022-03-13T17:05:36.250366+00:00 shinyapps[5825051]: 
2022-03-13T17:05:36.731366+00:00 shinyapps[5825051]: 
2022-03-13T17:05:36.731368+00:00 shinyapps[5825051]: Attaching package: ‘dplyr’
2022-03-13T17:05:36.731369+00:00 shinyapps[5825051]: 
2022-03-13T17:05:36.731613+00:00 shinyapps[5825051]: The following object is masked from ‘package:simmer’:
2022-03-13T17:05:36.731614+00:00 shinyapps[5825051]: 
2022-03-13T17:05:36.731615+00:00 shinyapps[5825051]: 
2022-03-13T17:05:36.731615+00:00 shinyapps[5825051]:     select
2022-03-13T17:05:36.731831+00:00 shinyapps[5825051]: The following objects are masked from ‘package:stats’:
2022-03-13T17:05:36.731833+00:00 shinyapps[5825051]: 
2022-03-13T17:05:36.731832+00:00 shinyapps[5825051]: 
2022-03-13T17:05:36.731833+00:00 shinyapps[5825051]:     filter, lag
2022-03-13T17:05:36.732035+00:00 shinyapps[5825051]: 
2022-03-13T17:05:36.732034+00:00 shinyapps[5825051]: The following objects are masked from ‘package:base’:
2022-03-13T17:05:36.732035+00:00 shinyapps[5825051]:     intersect, setdiff, setequal, union
2022-03-13T17:05:36.732036+00:00 shinyapps[5825051]: 
2022-03-13T17:05:37.031099+00:00 shinyapps[5825051]: 
2022-03-13T17:05:37.031101+00:00 shinyapps[5825051]: Listening on http://127.0.0.1:45623
2022-03-13T17:09:05.236081+00:00 shinyapps[system]: Out of memory!


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source