Comments (13)
I had an issue where chrome would crash, I fixed it by changing this:
case 'circle':
pJS.canvas.ctx.arc(p.x, p.y, radius, 0, Math.PI * 2, false);
break;
To this:
case 'circle':
try {
pJS.canvas.ctx.arc(p.x, p.y, radius, 0, Math.PI * 2, false);
} catch(err) {
//alert(err);
}
break;
You'll see the error that occurs if you uncomment the alert
from particles.js.
Hi @4DiGITS,
Are you on a retina display, or have you set an svg image as a particle for example (into the json config)?
These two cases involve heavy calculations and may crash the browser unfortunately.
from particles.js.
Thanks for your quick response. I am not working on a retina display nor do I use svg particles. However, retina detection is set to 'true'. Don't know if that has a performance implication. Would appreciate your comment on my json configuration, which I adapted from the original setting. Maybe there is some room for performance improvements:
{
"particles": {
"number": {
"value": 100,
"density": {
"enable": true,
"value_area": 1920
}
},
"color": {
"value": "#fff"
},
"shape": {
"type": "none",
"stroke": {
"width": 0,
"color": "#000000"
},
"polygon": {
"nb_sides": 5
}
},
"opacity": {
"value": 1,
"random": false,
"anim": {
"enable": false,
"speed": 1,
"opacity_min": 1,
"sync": false
}
},
"size": {
"value": 7,
"random": true,
"anim": {
"enable": false,
"speed": 40,
"size_min": 0.1,
"sync": false
}
},
"line_linked": {
"enable": true,
"distance": 150,
"color": "#fff",
"opacity": 1,
"width": 1.2
},
"move": {
"enable": true,
"speed": 3,
"direction": "none",
"random": false,
"straight": false,
"out_mode": "out",
"attract": {
"enable": false,
"rotateX": 600,
"rotateY": 1200
}
}
},
"interactivity": {
"detect_on": "canvas",
"events": {
"onhover": {
"enable": false,
"mode": "repulse"
},
"onclick": {
"enable": false,
"mode": "push"
},
"resize": true
},
"modes": {
"repulse": {
"distance": 400,
"line_linked": {
"opacity": 1
}
},
"bubble": {
"distance": 400,
"size": 40,
"duration": 2,
"opacity": 8,
"speed": 3
},
"repulse": {
"distance": 50
},
"push": {
"particles_nb": 4
},
"remove": {
"particles_nb": 2
}
}
},
"retina_detect": true
}
from particles.js.
Hi @4DiGITS, sorry for the late reply!
I just tested your configuration, and i have no problem. I tested the script on Windows, OSX, but not on Linux, i hope this is not the issue :s
from particles.js.
Hi @VincentGarreau, great library.
I'm playing around with it but if I put a svg image it crashes both on Chrome and Firefox on Mac.
It happens even if I choose a very small amount of particles (10-20 of them).
Have you got any suggestions?
Thank you
from particles.js.
Hi @Serse, thanks!
Load svg image is actually a heavy process unfortunately, i'll try to improve it. If your svg image is heavy it may crash with a very small amount of particles. Try with a lighter svg image maybe, or png :)
from particles.js.
Thank you @VincentGarreau
Keep up the good job ;)
from particles.js.
Something similar happens here.
Memory consumption in Chrome starts growing at a rate of ~2Mb per second...
At some point, the only way to continue using Chrome is to kill the tab (f it doesn't crash by itself)
Any clue on possible memory leaks or unclean loops/intervals?
Thank you!
from particles.js.
Bad memory leak .. chrome, firefox , everywhere.... My workaround was to destroy the instance and recreate to free memory and re allocate, but this is not a solution ..
from particles.js.
I have used particle.js as a background of a website! The problem is, it is running only in firefox 46. but not in chrome or chromium or Microsoft edge! Not able to understand the problem! :(
from particles.js.
I'm currently also experiencing the memory leaks. Is there a proven fix for this already? As you can see I use the script as a dependency of pagekit/theme-avion.
-edit-
Currently testing the solution of @ashking08
from particles.js.
Thanks @ashking08 that indeed seemed to do the trick.
from particles.js.
No worries @jdegger glad I could help
from particles.js.
Related Issues (20)
- decrease the movement speed
- Can't interact with the page content - Elementor HOT 1
- Particle.js overlaps everything HOT 1
- Push particles based on variable change in a seperate function HOT 3
- Render single frame for prefers-reduced-motion HOT 1
- How to disable interactivity HOT 1
- s
- Problem with particles.js 2023 HOT 1
- Particles dont interact while hovering or clicking HOT 1
- Uncaught ReferenceError: Stats is not defined in Wordpress HOT 1
- idk
- how to use config file HOT 1
- particals js error
- Documentation HOT 2
- Make code compatible with ES5 strict mode HOT 2
- How can I reset the particles to initial position?
- Particles as a background
- New particles duration?
- Hold down instead of on click on push animation?
- Rotate is not working?
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 particles.js.