OOM in nuxtjs, these could cause the memory leakage?

Recently, I have debugged legacy codes. One of our service occurred OOM issue. After server load testing, I thought two of things could cause the problem. One is the methods which is defined out of the component and the other is the socket method which don’t have disconnection in created method.

In the index.vue


const definedOutOfComponent () => {
   // requestData
}

export default {

  asyncData() { 
    definedOutOfComponent();
  }

  created() {
    this.setSocket();
  }

  setSocket() {
    
    // setSocket method doesn't have disconnection.
    
  }

}

Here is the reason that why I thought this two things cause the problem. First, method like definedOutOfComponent will be created every access and there is no disconnection on setSocket method.

But, I’m newer of NuxtJs. So, I need a help to advanced developer’s opinion. Do you think it could effect on memory leakage?