Changeset 1973


Ignore:
Timestamp:
Dec 6, 2009 6:26:45 PM (11 years ago)
Author:
wehart
Message:

Merged revisions 1949-1972 via svnmerge from
https://software.sandia.gov/svn/public/coopr/coopr.opt/trunk

........

r1955 | jwatson | 2009-12-02 17:55:38 -0700 (Wed, 02 Dec 2009) | 3 lines


Fixed missing StringIO module import.

........

r1960 | jwatson | 2009-12-04 20:43:24 -0700 (Fri, 04 Dec 2009) | 5 lines


Fixed a major memory leak in the solver manager. When get_results() was previously invoked, the action handle was referenced as a key in the map, and the corresponding results object was deleted. However, it wasn't cleaned up in the solver manager results map. Consequently, the solver manager kept a copy of every result object ever created, which reaches GB size for long PH runs.


This *might* result in a slight change in semantics, but I don't think so: once a solver result is returned from the manager, whoever got it "owns it". In other words, you can't grab the result multiple times.

........

Location:
coopr.opt/stable/2.1
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • coopr.opt/stable/2.1

  • coopr.opt/stable/2.1/coopr/opt/parallel/manager.py

    r1768 r1973  
    174174        """
    175175        if ah.id in self.results:
    176             return self.results[ah.id]
     176            # extremely important - clean up the map before returning the result.
     177            # otherwise, it will be around forever, acting as a memory leak (because
     178            # the solver manager will always retain a reference).
     179            result = self.results[ah.id]
     180            del self.results[ah.id]
     181            return result
    177182        return None
    178183
  • coopr.opt/stable/2.1/coopr/opt/results/results.py

    r1949 r1973  
    1616from pyutilib.misc import Bunch
    1717import copy
     18
     19import StringIO
    1820
    1921import problem
Note: See TracChangeset for help on using the changeset viewer.