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
LLMやAIエージェントをソフトウェアに組み込むプラクティス
shibuiwilliam
2
420
Making sense of Google’s agentic dev tools
glaforge
1
280
世界、断片、モデル。そして理解
ardbeg1958
1
130
Compose 新機能総まとめ / What's New in Jetpack Compose
yanzm
0
320
しぶいSRE: サーバから見えない障害にどう向き合うか。ラストワンマイルのデバッグ実践 / Shibui SRE
kanny
13
6.6k
AI、CDK と協働する Full TypeScript アプリケーション開発 / Full TypeScript Application with AI and CDK
geekplus_tech
2
400
AI Driven AI Governance
pict3
0
490
AIが実装を自走する時代の認知負債との戦い
lycorptech_jp
PRO
1
360
AIと共生する開発者プラットフォーム:バクラクのモノレポ×マイクロサービス基盤
sakajunquality
2
3.9k
発表と総括 / Presentations and Summary
ks91
PRO
0
140
ruby.wasmとPicoRuby.wasmに対応した仮想DOMライブラリを作ってる話 #kaigieffect_kaigi
sue445
PRO
0
150
GoでCコンパイラを作った話
repunit
0
110
Featured
See All Featured
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
220
Being A Developer After 40
akosma
91
590k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.9k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
11k
YesSQL, Process and Tooling at Scale
rocio
174
15k
A Soul's Torment
seathinner
6
3.1k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
900
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
490
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.9k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
190
Speed Design
sergeychernyshev
33
1.9k
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