Comments (3)
Тесты с visualVM показали скачки heap-а до 300 мб, если запустить цикл скажем на 1000 итераций клиента. Скачки эти были замечены что в Дэке что в Стеке. Основной класс, потребляющий память в хипе - массив символов, то есть те сами обрабатываемые строки из "Войны и мира".
В Деке я ничего не придумал, что можно было бы сделать.
В Стеке я переписал процедуру возврата последнего элемента
с
return (K) data[size--];
на
K item = (K) data[size-1];
data[size-1] = null;
size--;
return item;
from stacks.
Честно говоря, особой разницы в мониторе расхода памяти не заметил (((
Ну, может быть пиковые значения с 300+ Мб немного уменьшились до 250-280 Мб.
from stacks.
Кажись понял в чем дело и как это решить.
Прогнал тест, на котором 10 раз пушил в стек примерно 10 млн элементов, затем pop() их до нуля.
В первом случае: стабильно держит хип 700мб
Во втором - на этапе чистки Стека уменьшает Хип до 200 мб
from stacks.
Related Issues (13)
- Memory issue HOT 1
- Memory leak HOT 1
- Fixed size HOT 4
- Iteration HOT 6
- Collection construction HOT 3
- Stack/Deque client HOT 1
- Stack/Deque tests HOT 2
- Stack resizing HOT 3
- encoding issue HOT 1
- file read issue HOT 2
- redundant code HOT 4
- class files commited HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stacks.