Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Stretchly spawns a lingering process on each break #925

Closed
4 tasks done
Anonymity opened this issue Apr 20, 2021 · 12 comments · Fixed by #949
Closed
4 tasks done

[BUG] Stretchly spawns a lingering process on each break #925

Anonymity opened this issue Apr 20, 2021 · 12 comments · Fixed by #949
Labels

Comments

@Anonymity
Copy link

Prerequisites

  • I'm using latest version: v 1.6.0
  • I've checked Known issues
  • I've checked Open issues
  • I've read Code of Conduct. By filing an Issue, you are expected to comply with it, including treating everyone with respect.

Description

stretchly process

I looked at task manager and noticed there are hundreds of stretchly processes. I closed and restarted stretchly. I see there are a few Stretchly.exe in task manager, and on each break a new process is spawned.

Operating system: Windows 10 20H2

Steps to Reproduce

  1. Open task manager. Count how many Stretchly.exe there are.
  2. Right click on stretchly tray menu and skip to next break.
  3. Repeat step 2 while watching number of stretchly processes in task manager goes up.

Expected behavior: Number of stretchly process (and memory usage) remains roughly constant.

Actual behavior: Stretchly keeps spawning processes.

Reproduces how often: 100%

Additional Information

None

Debug information

config.json (I have never edited this manually)
{
	"microbreakDuration": 20000,
	"microbreakInterval": 600000,
	"breakDuration": 300000,
	"breakInterval": 2,
	"breakNotification": true,
	"microbreakNotification": true,
	"breakNotificationInterval": 30000,
	"microbreakNotificationInterval": 10000,
	"microbreak": true,
	"break": false,
	"microbreakStrictMode": false,
	"breakStrictMode": false,
	"morningHour": 6,
	"microbreakPostpone": true,
	"breakPostpone": true,
	"microbreakPostponeTime": 120000,
	"breakPostponeTime": 300000,
	"microbreakPostponesLimit": 1,
	"microbreakPostponableDurationPercent": 30,
	"breakPostponesLimit": 1,
	"breakPostponableDurationPercent": 30,
	"mainColor": "#478484",
	"transparentMode": false,
	"opacity": 0.9,
	"audio": "crystal-glass",
	"volume": 1,
	"fullscreen": true,
	"ideas": true,
	"naturalBreaks": true,
	"naturalBreaksInactivityResetTime": 300000,
	"allScreens": true,
	"useIdeasFromSettings": false,
	"language": "en",
	"notifyNewVersion": true,
	"isFirstRun": false,
	"posLatitude": 0,
	"posLongitude": 0,
	"useMonochromeTrayIcon": true,
	"useMonochromeInvertedTrayIcon": true,
	"silentNotifications": true,
	"monitorDnd": true,
	"microbreakStartSoundPlaying": false,
	"breakStartSoundPlaying": false,
	"themeSource": "system",
	"endBreakShortcut": "CmdOrCtrl+X",
	"breakWindowWidth": 0.85,
	"breakWindowHeight": 0.85,
	"checkNewVersion": true,
	"breakIdeas": [
		{
			"data": [
				"Not alone",
				"Do you find it hard to take a break alone? Try to do it with a co-worker. Aside from making it easier to stick to breaks, you will have a chance to get to know them better. Taking breaks together increases productivity."
			],
			"enabled": true
		},
		{
			"data": [
				"Step away",
				"Do you ever notice how your brain can figure things out by itself? All it takes is to step away from the computer and take a break to think about something totally unrelated."
			],
			"enabled": true
		},
		{
			"data": [
				"Microbreaks",
				"Rest is a key component in ensuring the performance of the musculoskeletal system. Frequent breaks can decrease the duration of a task and help lower the exposure to ergonomic injury risk."
			],
			"enabled": true
		},
		{
			"data": [
				"Meditation",
				"Research studies suggest that mindfulness-based exercises help decrease anxiety, depression, stress, and pain, and help improve general health, mental health, and quality of life. Not sure how to start? There are numerous apps to help you out."
			],
			"enabled": true
		},
		{
			"data": [
				"Blink",
				"Looking at screens for a long time causes you to blink less, thus exposing your eyes to the air. Blink rapidly for a few seconds to refresh the tear film and clear dust from the eye surface."
			],
			"enabled": true
		},
		{
			"data": [
				"Ergonomics",
				"Improper height and angle of the keyboard, mouse, monitor or working surface can cause health problems. Take some time to read about desk ergonomics."
			],
			"enabled": true
		},
		{
			"data": [
				"Move",
				"There are a lot of ways you can exercise within your office. Try marching in place or doing desk push-ups."
			],
			"enabled": true
		},
		{
			"data": [
				"Change",
				"Do you have a stability ball or standing work desk? Consider replacing your desk chair with them for a while."
			],
			"enabled": true
		},
		{
			"data": [
				"Notice",
				"Are you daydreaming or having trouble focusing? It is a sign that you need to take a break."
			],
			"enabled": true
		},
		{
			"data": [
				"Tech",
				"How about taking a no-tech walk?"
			],
			"enabled": true
		},
		{
			"data": [
				"Metabolism",
				"Emerging research shows that sitting for long periods of time contributes to risk of metabolic syndrome, heart attack and stroke risk and overall death risk, among others. Taking regular walking breaks can help your circulation, working to counteract some of those problems."
			],
			"enabled": true
		},
		{
			"data": [
				"Active Meetings",
				"How about moving meetings from the conference room to the concourse? Walking not only burns calories but it may even foster a sense of collaboration."
			],
			"enabled": true
		},
		{
			"data": [
				"Fruit",
				"Take your time and eat some fruit. Slowly. Notice the flavor, the texture, the freshness."
			],
			"enabled": true
		},
		{
			"data": [
				"Bathrooms",
				"Walk to the farthest bathroom in the worksite facility when going to the restroom."
			],
			"enabled": true
		},
		{
			"data": [
				"Coffee break",
				"Going on coffee break? Consider doing a 5-minute walk every time you go for one."
			],
			"enabled": true
		},
		{
			"data": [
				"Colleagues",
				"Do not email or message office colleagues, walk to their desks to communicate with them."
			],
			"enabled": true
		}
	],
	"microbreakIdeas": [
		{
			"data": "Go grab a glass of water.",
			"enabled": true
		},
		{
			"data": "Slowly look all the way left, then right.",
			"enabled": true
		},
		{
			"data": "Slowly look all the way up, then down.",
			"enabled": true
		},
		{
			"data": "Close your eyes and take few deep breaths.",
			"enabled": true
		},
		{
			"data": "Close your eyes and relax.",
			"enabled": true
		},
		{
			"data": "Stretch your legs.",
			"enabled": true
		},
		{
			"data": "Stretch your arms.",
			"enabled": true
		},
		{
			"data": "Is your sitting posture correct?",
			"enabled": true
		},
		{
			"data": "Slowly turn head to side and hold for 10 seconds.",
			"enabled": true
		},
		{
			"data": "Slowly tilt head to side and hold for 5-10 seconds.",
			"enabled": true
		},
		{
			"data": "Stand from chair and stretch.",
			"enabled": true
		},
		{
			"data": "Refocus eyes on an object at least 20 meters away.",
			"enabled": true
		},
		{
			"data": "Take a moment to think about something you appreciate.",
			"enabled": true
		},
		{
			"data": "Take a moment to smile at being alive.",
			"enabled": true
		}
	],
	"showBreaksAsRegularWindows": false,
	"appExclusions": [],
	"pauseForSuspendOrLock": true
}
@hovancik
Copy link
Owner

Hi, that's how electron works. Stretchly is built with electron.

@Anonymity
Copy link
Author

Ouch. So I need to manually restart Stretchly regularly to avoid memory leak?

@hovancik
Copy link
Owner

I might be wrong but I don't think it is a memory leak. Look for example on Slack or other electron based apps, they have many processes as well.

@Anonymity
Copy link
Author

Having many processes isn't a problem if it doesn't grow. But in stretchly's case it starts off with 4, then goes up by 1 every break. I rarely reboot so over time there are literally hundreds of processes.

@hovancik
Copy link
Owner

hovancik commented Apr 21, 2021

Ok, I don't have Windows but let me try on Linux. Just quited Stretchly, started again and I have 8 processes running. We'll update later if I don't forget.

I am doing regular close() so if there is a issue, it's probably electron

update: also on Linux

@hovancik hovancik reopened this Apr 21, 2021
@hovancik
Copy link
Owner

Not sure if same, will have to read later, but quick search finds this: electron/electron#21586

@aniket-banyal
Copy link

Facing the same problem on windows, new process gets spawned after every break.

@XuhuiSun95
Copy link

XuhuiSun95 commented Apr 26, 2021

I think it has some sort of memory leak issue.

For me on Linux - ubuntu 20.04, snap version. I also experience the VRAM leak issue.
The application will eat up all the VRAM slowly. I have not experienced this issue at version 1.4. but it happens in 1.5 and 1.6.

@metalalive
Copy link

metalalive commented May 1, 2021

I get the same issue with .deb version of Stretchly v1.6 installed in Ubuntu 14.04 and 16.04 LTS, it spawns after each break and uses ~3GB memory . It seems harmless to manually kill the spawned processes.

@hovancik hovancik mentioned this issue May 1, 2021
4 tasks
@jmagaram
Copy link

jmagaram commented May 3, 2021

I get this too on Windows 10.

@TrutzX
Copy link

TrutzX commented May 3, 2021

Hello,
I love the app. Have now updated to the 1.6. Every time a break starts, a new process is started on each monitor. But the old processes are not closed. One process consumes 19 MB Ram for me, so 10 min break * 3 monitor * 19 MB = 350 MB Ram per hour * 10 hours => 3,5 GB Ram per day extra.

Emergency solution:
A cronjob on my ubuntu kills stretchly daily and then restart stretchly.

@hovancik
Copy link
Owner

hovancik commented May 4, 2021

Sorry guys, but looks like noone is working on this on Electron's side: electron/electron#21586

oxalica added a commit to oxalica/nixpkgs that referenced this issue Jul 28, 2021
It contains a bug fix for electron process leak on every break.

hovancik/stretchly#925
github-actions bot pushed a commit to NixOS/nixpkgs that referenced this issue Jul 29, 2021
It contains a bug fix for electron process leak on every break.

hovancik/stretchly#925
(cherry picked from commit 327e6a9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants