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
66
Succeeding with Sencha Development
andrewmduncan
0
69
Securing Client-Side Data
andrewmduncan
0
150
Strategies for Working with Offline Data
andrewmduncan
1
170
Other Decks in Technology
See All in Technology
最適な自走を最小限の支援で — M&Aで拡大する組織で少人数SREが挑んだ1年 / SRE NEXT 2026
genda
0
1.2k
知らん間に、回ってる
ming_ayami
0
580
完全自律ロボットを作りたくて、先に開発を自律させた話(ROS Japan UG #63 LT)
rryz09
0
570
ゴールデンパスは敷いただけでは道にならない ─ 企画部門のエンジニアが技術標準を事業価値に変えるまで
mhrtech
1
150
AI時代のエンジニアキャリアについて今一度考える
sakamoto_582
2
1.5k
インフラと開発の垣根を超えていき!〜元AWSインフラエンジニアがAWS開発で奮闘している話〜
hatahata021
3
180
GuardrailからGovernanceへ~AIエージェント運用の次の課題~
sbspsy
2
280
実装だけじゃない! CCA-F取得エンジニアが教えるClaude Code開発プロセス活用術
diggymo
2
710
公式ドキュメントの歩き方etc
coco_se
0
100
Kaggleで成長するために意識したこと
prgckwb
2
340
事業価値を⽣み出すSREへ SREが担うべき意思決定の5層
kenta_hi
2
3.6k
AI時代の EM への処方箋
staka121
PRO
0
140
Featured
See All Featured
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
The Cost Of JavaScript in 2023
addyosmani
55
10k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.5k
Visualization
eitanlees
152
17k
Why Our Code Smells
bkeepers
PRO
340
58k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Claude Code のすすめ
schroneko
67
230k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
490
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2.1k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
260
GraphQLとの向き合い方2022年版
quramy
50
15k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
220
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