Skip to content

large memory usage CEconItem #254

@Mr-VIT

Description

@Mr-VIT

I discovered that I can’t load large inventory (260k items) because the application reaches the memory limit (over 500MB)
Having done the tests, I found that creating CEconItem takes a lot of memory. Keeping item data in {}Object instead of creating CEconItem app uses less 100MB.
After CEconItem constructor tests, I found this consumes the most memory: (possible memory leak)

delete this.currency;

after deleting this line or replacing it with this.currency=undefined memory usage decreased to 200MB with fully loaded inventory

Report on app crash:

Heap::RecomputeLimits(v8::internal::GarbageCollector)
Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags)
Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags)
Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment)
Factory::NewFixedArrayWithFiller(v8::internal::RootIndex, int, v8::internal::Object, v8::internal::AllocationType)
Handle<v8::internal::FixedArray> v8::internal::Factory::NewFixedArrayWithMap<v8::internal::FixedArray>(v8::internal::RootIndex, int, v8::internal::AllocationType)
HashTable<v8::internal::NameDictionary, v8::internal::NameDictionaryShape>::New(v8::internal::Isolate*, int, v8::internal::AllocationType, v8::internal::MinimumCapacity)
BaseNameDictionary<v8::internal::NameDictionary, v8::internal::NameDictionaryShape>::New(v8::internal::Isolate*, int, v8::internal::AllocationType, v8::internal::MinimumCapacity)
JSObject::MigrateToMap(v8::internal::Isolate*, v8::internal::Handle<v8::internal::JSObject>, v8::internal::Handle<v8::internal::Map>, int)
[>>>>]LookupIterator::Delete()
[>>>>]JSReceiver::DeleteProperty(v8::internal::LookupIterator*, v8::internal::LanguageMode)
[>>>>]Runtime::DeleteObjectProperty(v8::internal::Isolate*, v8::internal::Handle<v8::internal::JSReceiver>, v8::internal::Handle<v8::internal::Object>, v8::internal::LanguageMode)
[>>>>]Runtime_DeleteProperty(int, unsigned long*, v8::internal::Isolate*)

I understand that this problem is in NodeJS, but here, too, must be fixed.

NodeJS v14.4
Large inventory for testing: 76561198848470192

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions