nodejs TiddlyWiki consuming lots of mem comparing to my small wiki

227 views
Skip to first unread message

Charlie Brown

unread,
Jun 1, 2015, 8:12:56 AM6/1/15
to tiddl...@googlegroups.com
Hi all,
I'm trying the nodejs server on my humble little virtual host, and it's costing 252.828 MB of total 512MB of its memory, while the dumped whole site is only 2MB.
Did I do something wrong?
Thanks in advance!

PMario

unread,
Jun 1, 2015, 12:38:53 PM6/1/15
to tiddl...@googlegroups.com
Hi Charlie,

If you ssh into your instance and try:

# top -n 1

you may see something similar to this, if your host runs a unix system. My instance here is an almost empty ubuntu system.

pmario@ubuntu:~$ top -n1
top - 18:33:02 up 0 min,  1 user,  load average: 0,31, 0,08, 0,03
Aufgaben: 232 total,   1 running, 231 sleeping,   0 stopped,   0 zombie
%Cpu(s):  4,9 be,  6,2 sy,  0,0 ni, 73,3 un, 14,9 wa,  0,7 hi,  0,0 si,  0,0 st
KiB Mem:   2040208 total,   272652 used,  1767556 free,    23816 buffers
KiB Swap:  2097148 total,        0 used,  2097148 free.   152248 cached Mem

  PID BENUTZER  PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND


What you see here is the OS only.

If you start your node server and do the command again. You'll see the difference. That's what node and TW server command actually need.

hope that helps.
-mario

Charlie Brown

unread,
Jun 1, 2015, 9:03:12 PM6/1/15
to tiddl...@googlegroups.com

Yeah. I mean, I'm not that dumb:) I use free instead of top:
When I'm running the nodejs wiki server:

charlie@www:~$ free -h
             total       used       free     shared    buffers     cached
Mem:          997M       819M       177M        32M       116M       189M
-/+ buffers/cache:       513M       483M
Swap:         511M       444K       511M
------------------------------------------------------------------------------------
charlie@www:~$ free -h
             total       used       free     shared    buffers     cached
Mem:          997M       611M       386M        32M       116M       189M
-/+ buffers/cache:       304M       692M
Swap:         511M       444K       511M

--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/UYutj8ieh6k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/4f2a5861-63f2-48bc-875b-f548f9b93ac6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Charlie Brown

unread,
Jun 1, 2015, 9:10:31 PM6/1/15
to tiddl...@googlegroups.com

God I pressed some key and sent the email mistakenly. So I will start again with the measure. As you can see from the above, I upgraded my vhost yesterday, so now I have more memory, but I'm still interested.
Basicly the measure shows that the nodejs wiki server takes about 209M memory. Here's how I started the server:

/usr/lib/node_modules/tiddlywiki/tiddlywiki.js /var/www/tiddly --server 9000

Please tell me if I'm doing it wrong.

By the way, I'm using pm2 to manage the process. The parameter's are the same. And the memory usage are about the same, too.

--

Mirko de Almeida Madeira Clemente

unread,
Mar 17, 2017, 11:27:40 AM3/17/17
to tiddl...@googlegroups.com
Same problem here. Without any tiddlers I measured 209M of memory consumption. I created some tiddlers and added 2 or 3 images and the node process consumed about 300M. That's a pity as my shared hosting is also limited to 500M. I am afraid that it won't take long to hit the limit.

PMario

unread,
Mar 17, 2017, 12:31:06 PM3/17/17
to TiddlyWiki
On Friday, March 17, 2017 at 4:27:40 PM UTC+1, Mirko Clemente wrote:
Same problem here. Without any tiddlers I measured 209M of memory consumption. I created some tiddlers and added 2 or 3 images and the node process consumed about 300M. That's a pity as my shared hosting is also limited to 500M. I am afraid that it won't take long to hit the limit.

This may be of interest: http://fiznool.com/blog/2016/10/01/running-a-node-dot-js-app-in-a-low-memory-environment/

As it seems. node doesn't garbage collect until it hits any limits. So the OS tools probably don't show the reality.

-m

Mirko Clemente

unread,
Mar 17, 2017, 12:38:43 PM3/17/17
to TiddlyWiki
Thank you for the link. I'll definitely have a look on it. But I'm not sure if it applies to TW. Somewhere I read that it loads all tiddlers into memory. I think this strategy explains the high memory consumption.

Jed Carty

unread,
Mar 17, 2017, 12:47:49 PM3/17/17
to TiddlyWiki
Loading all tiddlers into memory doesn't explain that sort of memory consumption. The entire html file is loaded into memory when you load it in the browser and all the tiddlers are part of the html file. And the entire wiki (which includes all the tiddlers) is pretty small anyway, nowhere near 200MB.
Reply all
Reply to author
Forward
0 new messages