[tor-bugs] #20335 [Metrics/CollecTor]: ReferenceChecker causes OOM

Tor Bug Tracker & Wiki blackhole at torproject.org
Tue Oct 18 08:09:27 UTC 2016


#20335: ReferenceChecker causes OOM
-------------------------------+---------------------
 Reporter:  iwakeh             |          Owner:
     Type:  defect             |         Status:  new
 Priority:  Medium             |      Milestone:
Component:  Metrics/CollecTor  |        Version:
 Severity:  Normal             |     Resolution:
 Keywords:                     |  Actual Points:
Parent ID:                     |         Points:
 Reviewer:                     |        Sponsor:
-------------------------------+---------------------

Comment (by iwakeh):

 I think I found a way to avoid the oom:

 The sync-process provides collector with many (in the constant*10E+6
 range) new descriptor references that are actually stale.  I added a check
 for the valid date to `addReference`, i.e.
 {{{

    private void addReference(String referencing, String referenced,
        double weight, long expiresAfterMillis) {
 -    this.references.add(new Reference(referencing.toUpperCase(),
 -        referenced.toUpperCase(), weight, expiresAfterMillis));
 +    if (this.currentTimeMillis <= expiresAfterMillis) {
 +      this.references.add(new Reference(referencing.toUpperCase(),
 +          referenced.toUpperCase(), weight, expiresAfterMillis));
 +    }
 }}}

 This seems to reduce the used memory; the sync-test is still running ...

 Is there anything problematic with this change that I missed?

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/20335#comment:9>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list