Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#6 Resource usage improvements

open
nobody
None
5
2005-08-22
2005-08-22
Dan Mindler
No

The following modifications are suggested to improve
resource usage. We were running out of file descriptors
in our process and these changes helped our application:

1. com.swabunga.spell.engine.Configuration.java:

create only one default static final
PropertyConfiguration instance (as a singleton) and
return it when the className is null:

public static final Configuration
getConfiguration(String className)

2. com.swabunga.spell.engine.PropertyConfiguration.java:

In the constructor and save() methods, close the
streams appropriately. Since they weren't explicitly
closed, the file descriptors would stay in use until
the finalizer closed the streams.

Discussion