Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Memory Leak Health Check
Search
Andrew Duncan
May 10, 2015
Technology
590
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Memory Leak Health Check
Andrew Duncan
May 10, 2015
More Decks by Andrew Duncan
See All by Andrew Duncan
Using Ext JS 6 for Mobile Development
andrewmduncan
0
150
Scot-Cloud 15 - Using Cloud as an enabler for Web/Mobile
andrewmduncan
0
68
Succeeding with Sencha Development
andrewmduncan
0
71
Securing Client-Side Data
andrewmduncan
0
150
Strategies for Working with Offline Data
andrewmduncan
1
180
Other Decks in Technology
See All in Technology
みてねにおけるAI-DLC導入活動とAIドリブン開発の現在地/JAWS-UG AI-DLC #2
isaoshimizu
2
280
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
54k
最新技術に積極チャレンジ!EKS共通基盤のこれまでとこれから
daitak
0
250
Master Dataグループ紹介資料
sansan33
PRO
1
4.8k
現場の暗黙知を継承するAIエージェント — 対話から生まれる長期記憶と Skills
atsukish
0
130
1.5時間を無駄にして学んだwsl2におけるaptとsnapの選択と仕組み
yosaka0123
0
460
[ホンマでっか SRE] あなたはなぜ SRE に?
_awache
0
360
8bit CPU 2026
koba789
7
3k
ブラウザで変わるID連携(OAuth/OIDC Numa (Immersion) Workshop 2026)
oidfj
PRO
0
350
カーネルまで探検して理解するふたつの自動計装
sumiyae
0
340
markdown-poster Introduction
kazamori
0
400
サービス内で複数のOP・ASを連鎖させる(OAuth/OIDC Numa (Immersion) Workshop 2026)
oidfj
PRO
0
350
Featured
See All Featured
The Pragmatic Product Professional
lauravandoore
37
7.4k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.4k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
300
How to train your dragon (web standard)
notwaldorf
97
6.8k
How STYLIGHT went responsive
nonsquared
100
6.2k
Amusing Abliteration
ianozsvald
1
270
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.3k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Building Applications with DynamoDB
mza
96
7.2k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.3k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
580
Navigating Team Friction
lara
192
16k
Transcript
Andrew Duncan Managing Director, SwarmOnline Member No. 149387 @andrewduncan
[email protected]
© 2015 SwarmOnline
1. Memory Management 2. Tools of the trade MEMORY LEAK
HEALTH CHECK Our Quest to Diagnose & Cure © 2015 SwarmOnline
WHY IS THIS TOPIC IMPORTANT? • Move to richer /
interactive applications • More use of JavaScript to achieve this • Single Page Applications • Cross integration of multiple frameworks and technologies • Multiple device types, operating systems and browsers © 2015 SwarmOnline
MEMORY LEAK DEFINITION mem . o . ry leak noun
COMPUTING noun: memory leak; plural noun: memory leaks a failure in a program to release discarded memory, causing impaired performance or failure. © 2015 SwarmOnline
YES • Garbage Collection NO • Coding Mishaps DOESN’T THIS
GET HANDLED FOR ME? © 2015 SwarmOnline
WHAT TOOLS DO WE HAVE © 2015 SwarmOnline
CHROME & DEVELOPER TOOLS •Task Manager •Timeline •Profiles © 2015
SwarmOnline
TASK MANAGER © 2015 SwarmOnline
•1st round of testing •Instantaneous view of memory •Useful for
monitoring changes over small periods of time TASK MANAGER © 2015 SwarmOnline
TIMELINE © 2015 SwarmOnline
• Monitors memory over time • Sudden drops === GC
• Look out for two things: • Steady rise in the chart • GC not returning to original memory usage TIMELINE © 2015 SwarmOnline
PROFILES © 2015 SwarmOnline
PROFILES •Identify increase in objects •Do comparison © 2015 SwarmOnline
RECORD HEAP ALLOCATIONS © 2015 SwarmOnline
RECORD HEAP ALLOCATIONS © 2015 SwarmOnline
N.B. • Memory is skewed just by having Chrome Developer
Tools open • Observer Effect © 2015 SwarmOnline
OTHER BROWSER TOOLS All of these browsers have tools that
can be used to monitor memory • Internet Explorer • Safari • Firefox © 2015 SwarmOnline
INTERNET EXPLORER DEVELOPER TOOLS © 2015 SwarmOnline
SAFARI FOR DEVELOPERS © 2015 SwarmOnline
FIREFOX DEVELOPER © 2015 SwarmOnline
TASK MANAGER & WINDOWS TOOLS • Record memory usage in
Perfmon & PsTools (PsList) • Plot and view memory usage over time • In our case 1 hour, 24 hours, 1 week, 1 month PsTools PsList © 2015 SwarmOnline
TASK MANAGER & WINDOWS TOOLS Pipe data out to CSV
for charting © 2015 SwarmOnline
AUTOMATE MEMORY MONITORING How do we do this? • Virtual
Machines • Auto snapshot every X minutes • Reduce Observer Effect • Graph your results © 2015 SwarmOnline
HOW TO DO THIS YOURSELF • Strip it back to
basics • App in container only • Send data but don’t enable parsing • Add in the data package • If your app has multiple parsers for different types of data, enable each data packet individually • Gradually add in your controllers and view • Each view will need tested individually • Create your app with only one view enabled • We run over 30 VM’s with different versions of an app to get as much coverage as possible © 2015 SwarmOnline
HOW TO DO THIS YOURSELF (2) • If you suspect
something is going wrong • Take snapshot • Run code • Take snapshot • Review differences • Obviously new data (e.g. Ajax requests) are going to skew your results between snapshots © 2015 SwarmOnline
FINAL THOUGHTS • If all else fails… • Or in
extreme circumstances…rm -rf* © 2015 SwarmOnline
Andrew Duncan Managing Director, SwarmOnline @andrewduncan
[email protected]
© 2015 SwarmOnline