Github user bryancall commented on a diff in the pull request:

    https://github.com/apache/trafficserver/pull/1063#discussion_r83501005
  
    --- Diff: proxy/Main.cc ---
    @@ -346,6 +346,54 @@ class DiagsLogContinuation : public Continuation
       }
     };
     
    +class MemoryLimit : public Continuation
    +{
    +public:
    +  MemoryLimit() : Continuation(new_ProxyMutex()), _memory_limit(0) { 
SET_HANDLER(&MemoryLimit::periodic); }
    +  ~MemoryLimit() { mutex = NULL; }
    +  int
    +  periodic(int event, Event *e)
    +  {
    +    if (event == EVENT_IMMEDIATE) {
    +      // rescheduled from periodic to immediate event
    +      // this is the indication to terminate
    +      delete this;
    +      return EVENT_DONE;
    +    }
    +    if (_memory_limit == 0) {
    +      // first time it has been run
    +      _memory_limit = 
REC_ConfigReadInteger("proxy.config.memory.max_usage");
    +    }
    +    if (_memory_limit > 0) {
    +      if (getrusage(RUSAGE_SELF, &_usage) == 0) {
    +        Debug("server", "memory usage - ru_maxrss: %ld memory limit: %" 
PRId64, _usage.ru_maxrss, _memory_limit);
    +        if (_usage.ru_maxrss > _memory_limit) {
    --- End diff --
    
    Fixed this. Did a divide by 1024 for the setting.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to