Sponsored Content
Full Discussion: Out of memory message
Top Forums UNIX for Beginners Questions & Answers Out of memory message Post 303044756 by stomp on Tuesday 3rd of March 2020 09:35:57 AM
Old 03-03-2020
Hi,

I just checked your script on a linux system without any output with a file with 1/3 million words in it (filesize 2700 KB: I used this file: wordlist.xz).

Takes < 0.5 second and uses 100 MB of ram.

Code:
{
   gsub(/[.,:;!?"<>\[\]#(){}]/,"")
    for(i=1; i<=NF; i++){
       trigram = word1 " " word2" " $i
       word1 = word2
       word2 = $i
       count[trigram]++
      }
  }

Code:
/usr/bin/time awk -f t.awk wordlist
0.39user 0.02system 0:00.41elapsed 99%CPU (0avgtext+0avgdata 101800maxresident)k
0inputs+0outputs (0major+25315minor)pagefaults 0swaps

System Info:

Code:
CPU: Quad Core Intel Core i7-2600 (-MT MCP-) speed/max: 3051/3800 MHz Kernel: 4.19.0-8-amd64 x86_64 Up: 4h 08m 
Mem: 9670.3/15995.6 MiB (60.5%) Storage: 931.51 GiB (89.1% used) Procs: 284 Shell: bash 5.0.3 inxi: 3.0.32

In a windows 10 virtual machine with 4 GB of RAM and with GNU awk 3.1.6 - downloaded as compiled binary it takes only little more time.

So it boils down to the question Peasant asked already...

Last edited by stomp; 03-03-2020 at 10:51 AM..
These 3 Users Gave Thanks to stomp For This Post:
 

10 More Discussions You Might Find Interesting

1. AIX

Printer Memory Message

Hello Everyone, I received the following (root) email. Does anyone know what causes this and how I can find the offending printer? Thanks in advance. Jim Message 2: From daemon Wed Nov 30 09:51:07 2005 Date: Wed, 30 Nov 2005 09:51:07 -0800 From: daemon To: root (2 Replies)
Discussion started by: jlslhills
2 Replies

2. Programming

shared memory and message queues

Hi, According to my understanding.. When message queues are used, when a process post a message in the queue and if another process reads it from the queue then the queue will be empty unlike shared memory where n number of processess can access the shared memory and still the contents remain... (2 Replies)
Discussion started by: rvan
2 Replies

3. Programming

How to limit max no of message in a posix message queue

Hii can anyone pls tell how to limit the max no of message in a posix message queue. I have made changes in proc/sys/fs/mqueue/msg_max But still whenever i try to read the value of max. message in the queue using attr.mq_curmsgs (where struct mq_attr attr) its giving the default value as 10.... (0 Replies)
Discussion started by: mohit3884
0 Replies

4. Shell Programming and Scripting

memory full warning message

Hi I wrote a script #!/usr/bin/ksh #set -x for fs in `df -k|awk '{print $1}'|sed -n "3,14 p"` do x=`df -kl | grep $fs | awk '{ print $5 }'` y=50% if then message="File System `df -k |grep $fs |awk '{print $6\", \"$5}'`... (1 Reply)
Discussion started by: namishtiwari
1 Replies

5. Solaris

How to find Total and Free Physical Memory and Logical Memory in SOLARIS 9

Hi, Im working on Solaris 9 on SPARC-32 bit running on an Ultra-80, and I have to find out the following:- 1. Total Physical Memory in the system(total RAM). 2. Available Physical Memory(i.e. RAM Usage) 3. Total (Logical) Memory in the system 4. Available (Logical) Memory. I know... (4 Replies)
Discussion started by: 0ktalmagik
4 Replies

6. Programming

How to deal with lots of data in memory in order not to run out of memory

Hi, I'm trying to learn how to manage memory when I have to deal with lots of data. Basically I'm indexing a huge file (5GB, but it can be bigger), by creating tables that holds offset <-> startOfSomeData information. Currently I'm mapping the whole file at once (yep!) but of course the... (1 Reply)
Discussion started by: emitrax
1 Replies

7. Solaris

restrcit physical memory with zone.max-locked-memory

Is it possible to restrict physical memory in solaris zone with zone.max-locked-memory just like we can do with rcapd ? I do not want to used rcapd (1 Reply)
Discussion started by: fugitive
1 Replies

8. Programming

POSIX Message Queue Memory Allocation

Hi, I wanted to know whether the POSIX message queues are statically allocated memory by the kernel based on the parameters specified in the open or as and when we send messages, memory are allocated? Does the kernel reserve the specified memory for the message queue irrespective of whether... (1 Reply)
Discussion started by: sumtata
1 Replies

9. Solaris

[DOUBT] Memory high in idle process on Solaris 10 (Memory Utilization > 90%)

Hi Experts, Our servers running Solaris 10 with SAP Application. The memory utilization always >90%, but the process on SAP is too less even nothing. Why memory utilization on solaris always looks high? I have statement about memory on solaris, is this true: Memory in solaris is used for... (4 Replies)
Discussion started by: edydsuranta
4 Replies

10. UNIX and Linux Applications

Ssmtp -t < /path/to/the/message.txt (How to format message.txt for html email)

ssmtp has been running well under Kubuntu 12.04.1 for plain text messages. I would like to send html messages with ssmtp -t < /path/to/the/message.txt, but I cannot seem to get the message.txt file properly formatted. I have tried various charsets, Content-Transfer-Encoding, rearranging the... (0 Replies)
Discussion started by: Ronald B
0 Replies
BOGOTUNE(1)															       BOGOTUNE(1)

NAME
bogotune - find optimum parameter settings for bogofilter SYNOPSIS
bogotune [-v] [-c config] [-C] [-d dir] [-D] [-r value] [-T value] -n okfile [[-n] okfile [...]] -s spamfile [[-s] spamfile [...]] [-M file] bogotune [-h] DESCRIPTION
Bogotune tries to find optimum parameter settings for bogofilter. It needs at least one set each of spam and non-spam messages. The production wordlist is normally used, but it can be directed to read a different wordlist, or to build its own from half the supplied messages. In order to produce useful results, bogotune has minimum message count requirements. The wordlist it uses must have at least 2,000 spam and 2,000 non-spam in it and the message files must contain at least 500 spam and 500 non-spam messages. Also, the ratio of spam to non-spam should be in the range 0.2 to 5. If you direct bogotune to build its own wordlist, it will use the half the input or 2000 messages (whichever is larger) for the wordlist. Message files may be in mbox, maildir, or MH folder or any combination. Msg-count files can also be used, but not mixed with other formats. OPTIONS
The -h option prints the help message and exits. The -v option increases the verbosity level. Level 1 displays the scan output in detail instead of using a progress meter. The -c filename option tells bogofilter to read the config file named. The -C option prevents bogotune from reading a configuration file. The -d dir option specifies the directory for the database. See the ENVIRONMENT section for other directory setting options. The -D option tells bogotune to build a wordlist in memory using the input messages. The messages are read and divided into two groups. The first group is used to build a wordlist (in ram) and the second is used for tuning. To meet the minimum requirements of 2000 messages in the wordlist and 500 messages for testing, when -D is used, there must be 2500 non-spam and 2500 spam in the input files. If there are enough messages (more than 4000), they will be split evenly between wordlist and testing. Otherwise, they will be split proportionately. The -n option tells bogotune that the following argument is a file (or folder) containing non-spam. Since version 1.0.3, multiple arguments to the -n option can be given. All non-option arguments until the next -s option will be treated as though they had been preceded by -n The -s option tells bogotune that the following argument is a file (or folder) containing spam. It can be repeated as often as necessary. Since version 1.0.3, multiple arguments to the -s can be given. All non-option arguments until the next -n option will be treated as though they had been preceded by -s. The -r value option tells bogotune to use the following parameter as the robx value. The -T value option tells bogotune to use the following parameter as fp target value. The -M file option tells bogotune to convert the file to message count format. This format provides a sorted list of each message's unique tokens, along with their ham and spam counts. Sorting hides the sense of the messages quite effectively, thus protecting privacy. The message-count format allows bogotune and bogofilter to score messages quickly without needing the original token database. ENVIRONMENT
Bogofilter uses a database directory, which can be set in the config file. If not set there, bogofilter will use the value of BOGOFILTER_DIR. Both can be overridden by the -ddir option. If none of that is available, bogofilter will use directory $HOME/.bogofilter. BUGS
Bogotune is not particularly robust when presented with garbage input. AUTHOR
The bogofilter developer team. For updates, see the bogofilter project page[1]. SEE ALSO
bogofilter(1), bogolexer(1), bogoupgrade(1), bogoutil(1) NOTES
1. the bogofilter project page http://bogofilter.sourceforge.net/ 04/15/2008 BOGOTUNE(1)
All times are GMT -4. The time now is 09:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy