Questions tagged [resource-management]
142 questions
13
votes
1 answer
String resource file naming schemes and management
A trivial question perhaps, but I'm interested in the answers. I'm currently refactoring some very large monolithic string resource files (one dumpster resource file per project, in about 30 projects). I'm splitting them such that we follow a…

womp
- 115,835
- 26
- 236
- 269
11
votes
1 answer
Why does Enumerable.Range Implement IDisposable?
Just wondering why Enumerable.Range implements IDisposable.
I understand why IEnumerator does, but IEnumerable doesn't require it.
(I discovered this while playing with my .Memoise() implementation, which has statement like
if (enumerable is…

Fowl
- 4,940
- 2
- 26
- 43
10
votes
1 answer
How to use Scala ARM with Futures?
I want to implement the ARM (automated resource management) pattern, where the resource is used asynchronously.
The problem
Suppose my resource looks like:
class MyResource {
def foo() : Future[MyResource] = ???
// Other methods returning…

danarmak
- 1,190
- 1
- 10
- 19
9
votes
13 answers
Looking for a solution to "Dishwasher At Work"
I am looking for an algorithm to apply to the "dishwasher at work" problem.
While it is great to be able to put dirty coffee cups etc. in it, you quickly run into the "what is the state of the dishes?" dilemma. If you walk up to the kitchen, can…

Nathan Voxland
- 15,453
- 2
- 48
- 64
8
votes
1 answer
docker run --cpuset is not having any effect
I started one docker container by specifying the cpuset to 1 cores:
docker run --cpuset-cpus="0"...
A second one by specifying the cpuset to 4 cores:
docker run --cpuset-cpus="0-3"...
I launched a load process within each container and I…

staticx
- 1,201
- 2
- 16
- 31
7
votes
1 answer
Why is there no ARM in Scala stdlib?
Why is there no ARM (like Clojure's with-open) provided in the Scala standard library?

unknown
- 71
- 1
7
votes
3 answers
Spark on YARN too less vcores used
I'm using Spark in a YARN cluster (HDP 2.4) with the following settings:
1 Masternode
64 GB RAM (50 GB usable)
24 cores (19 cores usable)
5 Slavenodes
64 GB RAM (50 GB usable) each
24 cores (19 cores usable) each
YARN settings
memory of…

D. Müller
- 3,336
- 4
- 36
- 84
7
votes
1 answer
Some std::unique_ptr uses and "gotchas"
What are some of C++11 std::unique_ptr uses and gotchas?
Can I use std::unique_ptr also to store dynamically allocated arrays?
Can I use std::unique_ptr also with resources using a custom deletion mechanism?

Mr.C64
- 41,637
- 14
- 86
- 162
7
votes
2 answers
RAII wrapper for function pairs and template specialization
I've written a RAII wrapper for C function pairs which initialize and release resources and it serves me well for most cases.
#include
#include
#include
#include
template

legends2k
- 31,634
- 25
- 118
- 222
6
votes
2 answers
Best practices for non-local exit with cleanup in C?
What is considered best practice for aborting on errors in C?
In our code base we currently have a pattern using
#define CHECKERROR(code) if(code) { return code; }
but this leads to resources not being closed in code of the form
/* not actual code…

kdb
- 4,098
- 26
- 49
6
votes
1 answer
Release of resources in AWS Lambda
I implement AWS Lambda function with Java and face with the question - how to release used resources correctly? In my function I make different calls of some resources: execute queries to DB, make REST-calls to third-party services (send StatsD…

Hleb
- 7,037
- 12
- 58
- 117
6
votes
5 answers
When not to use RAII for resource management
Can anyone provide me with one or more concrete examples in which RAII was not the most efficient method for resource management, and why?

IUnknownPointer
- 217
- 1
- 9
6
votes
6 answers
Why are file handles such an expensive resource?
In holy wars about whether garbage collection is a good thing, people often point out that it doesn't handle things like freeing file handles. Putting this logic in a finalizer is considered a bad thing because the resource then gets freed…

dsimcha
- 67,514
- 53
- 213
- 334
6
votes
1 answer
iPhone: Is there an automated way to identify unused resources?
As I've developed my app, I have imported and incorporated a lot of images, sounds, etc. I guess I could just write a shell script that greps the source code, but I'm wondering if there's an existing that will identify any unused resources in my…

John
- 1,549
- 1
- 13
- 15
5
votes
4 answers
Is C++ like resource management possible in Java
In C++ we have the Resource Acquisition Is Initialization (RAII) pattern, which greatly simplifies resource management. The idea is to provide some wrapping object for any kind of resources. The wrapping object's destructor is then responsible for…

oo_olo_oo
- 2,815
- 5
- 28
- 25