[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



#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
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs