LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-30-2016, 09:56 PM   #1
Thirdeyematt
Member
 
Registered: Aug 2016
Posts: 31

Rep: Reputation: Disabled
Trying to put a file into virtual memory many times


Hello,
So this will sound as if there is no purpose to this post, but actually I do need it done for a specific purpose that I have with the file. Thank you.

Ok, so basically what I need to do is to take a single image file on the computer and memory map the file into the virtual memory space. But I don't want to do this just once, I need to fill up my entire hard drive disk's virtual memory space.

The programs that I have found to do this will only put one file into virtual memory at a time. I need to put 20,000 of the same image file into virtual memory.

I have been trying for a while now to do this and saw that this forum has heavy traffic and hoped someone might know how this could be done. Thank you for any help!!
 
Old 08-30-2016, 09:59 PM   #2
Thirdeyematt
Member
 
Registered: Aug 2016
Posts: 31

Original Poster
Rep: Reputation: Disabled
Also want to note that I did find this exact question posted here already, but then someone said why do you need this, and they realized that they needed to put the files onto another computer. This is putting a file on one computer into the same computer's virtual memory space.
 
Old 08-31-2016, 08:14 AM   #3
Thirdeyematt
Member
 
Registered: Aug 2016
Posts: 31

Original Poster
Rep: Reputation: Disabled
Maybe there is a way this can be done with ftp, but somehow instead of a server, just make it go to the hard drive instead.
 
Old 08-31-2016, 08:51 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,627

Rep: Reputation: 7524Reputation: 7524Reputation: 7524Reputation: 7524Reputation: 7524Reputation: 7524Reputation: 7524Reputation: 7524Reputation: 7524Reputation: 7524Reputation: 7524
so what have you tried exactly?
 
Old 08-31-2016, 09:03 AM   #5
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
Originally Posted by Thirdeyematt View Post
Hello,
So this will sound as if there is no purpose to this post, but actually I do need it done for a specific purpose that I have with the file. Thank you.

Ok, so basically what I need to do is to take a single image file on the computer and memory map the file into the virtual memory space.
A memory mapped file will share the buffers. In fact, ANY duplicate file usage will share the buffers.
Quote:
But I don't want to do this just once, I need to fill up my entire hard drive disk's virtual memory space.
Hard drives don't have virtual space. To get even something resembling that you have to use compression.
Quote:
The programs that I have found to do this will only put one file into virtual memory at a time. I need to put 20,000 of the same image file into virtual memory.
The only way to do that is to run the same program multiple times. Each individual process will read the file into private memory thus you get separate copies.

NOTE: It is possible that the memory gets deduplicated. Besides saving memory, it also reduces page faults. And using a memory mapped file just page faults from the file - and minimizes the unnecessary wasted useage of memory.

Quote:
I have been trying for a while now to do this and saw that this forum has heavy traffic and hoped someone might know how this could be done. Thank you for any help!!
You still need to say why you need to do something that is inherently wasteful of resources.
 
Old 08-31-2016, 09:46 AM   #6
Thirdeyematt
Member
 
Registered: Aug 2016
Posts: 31

Original Poster
Rep: Reputation: Disabled
Basically, I don't want to confuse anyone, so this technology is similar to brainwave entrainment, which uses sounds to change your mind. Just google brainwave entrainment. This new technology gets more powerful the more times the file is in use, and since putting a file into virtual memory is technically being used by the computer, the more powerful it is to change your mind.

Yes, I have also tried writing up a simple Java program that memory maps an image file, and then repeats til the space is ful. However, I believe it is only putting the file into virtual memory every second. I need to put 20000 files into the virtual memory space instantly.

Another idea I have is to do this using ftp. I've read it's possible to put files into the virtual memory space with ftp, but not sure how to do this over and over again instantly.

Thank you for your help.
 
Old 08-31-2016, 10:33 AM   #7
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
Originally Posted by Thirdeyematt View Post
Basically, I don't want to confuse anyone, so this technology is similar to brainwave entrainment, which uses sounds to change your mind. Just google brainwave entrainment. This new technology gets more powerful the more times the file is in use, and since putting a file into virtual memory is technically being used by the computer, the more powerful it is to change your mind.

Yes, I have also tried writing up a simple Java program that memory maps an image file, and then repeats til the space is ful. However, I believe it is only putting the file into virtual memory every second. I need to put 20000 files into the virtual memory space instantly.
That is what the "virtual" in "virtual memory" means.
Quote:

Another idea I have is to do this using ftp. I've read it's possible to put files into the virtual memory space with ftp, but not sure how to do this over and over again instantly.
The ONLY way to do it is use a ramfs mount... And copy the file into multiple names on that tmpfs mount.

But doing so is just a waste of time and memory. It has NOTHING to do with brainwave entrainment.
Quote:
Thank you for your help.
 
Old 08-31-2016, 11:01 AM   #8
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,816
Blog Entries: 4

Rep: Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982
Quote:
Ok, so basically what I need to do is to take a single image file on the computer and memory map the file into the virtual memory space. But I don't want to do this just once, I need to fill up my entire hard drive disk's virtual memory space.
Trouble is, "the operating system is too smart for that." It knows that you have mapped the same file. Therefore, it will draw data for each mapping from the same file.

Furthermore, the contents of "a memory-mapped file" always only come from ... the mapped file. It is never "copied into" virtual memory and never consumes backing store.

Further-more, Linux will not allow you to consume all of the physical swap resource. (That would be a denial-of-service attack upon the system.)
 
Old 08-31-2016, 03:02 PM   #9
Thirdeyematt
Member
 
Registered: Aug 2016
Posts: 31

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by sundialsvcs View Post
Trouble is, "the operating system is too smart for that." It knows that you have mapped the same file. Therefore, it will draw data for each mapping from the same file.

Furthermore, the contents of "a memory-mapped file" always only come from ... the mapped file. It is never "copied into" virtual memory and never consumes backing store.

Further-more, Linux will not allow you to consume all of the physical swap resource. (That would be a denial-of-service attack upon the system.)


As long as the file is in the virtual memory of the computer, it does not matter where data is drawn from. Well, it doesn't need to be 'copied into' virtual memory as long as that same file fills up the virtual memory space.

As for filling up the virtual memory space of the computer, I already have a program that does all of this on Windows, so maybe I just need it to fill up 99% of the virtual memory space because I know it can be done with no errors.
 
Old 08-31-2016, 03:06 PM   #10
Thirdeyematt
Member
 
Registered: Aug 2016
Posts: 31

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jpollard View Post
That is what the "virtual" in "virtual memory" means.

The ONLY way to do it is use a ramfs mount... And copy the file into multiple names on that tmpfs mount.

But doing so is just a waste of time and memory. It has NOTHING to do with brainwave entrainment.
Actually this technology is different than brainwave entrainment, but the exact same concept. This new technology, you don't need to listen to anything. You just need to have a computer with the image file in the virtual memory space or opened with ram to feel the effects.

Thank you for the ramfs suggestion with tmpfs I am going to have to try this way.
 
Old 08-31-2016, 03:59 PM   #11
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
Originally Posted by Thirdeyematt View Post
Actually this technology is different than brainwave entrainment, but the exact same concept.
Not even close. brainwave entrainment involves unconscious information exchange. You aren't exchanging information with anything by having the memory of a computer loaded with arbitrary information (or even random data for that matter).
Quote:
This new technology, you don't need to listen to anything. You just need to have a computer with the image file in the virtual memory space or opened with ram to feel the effects.
"feel the effects"? not a chance. The only time you can have an effect from an image is by LOOKING at the image. And then it will only be the size of the display. 1920x1080 is a fair number of pixels, but very likely the "image" is only an "image" in the video hardware. Just being in the memory of the computer will do nothing.
Quote:

Thank you for the ramfs suggestion with tmpfs I am going to have to try this way.
tmpfs will use swap, which is why I suggested using ramfs. All you will do with tmpfs is fill swap. Not the "virtual memory". Ramfs will allocate a specified amount of physical memory - which can then be used as a file store.
 
Old 08-31-2016, 05:25 PM   #12
Thirdeyematt
Member
 
Registered: Aug 2016
Posts: 31

Original Poster
Rep: Reputation: Disabled
This technology works, you can trust me... If you think that something is impossible then you just don't have an open mind dude . Well I'm not trying to be harsh it's just that I know it works, and I need it done so I tried to get it done by myself and it didn't so I am now asking for help...

Last edited by Thirdeyematt; 08-31-2016 at 05:28 PM. Reason: None
 
Old 08-31-2016, 08:17 PM   #13
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
Originally Posted by Thirdeyematt View Post
This technology works, you can trust me... If you think that something is impossible then you just don't have an open mind dude . Well I'm not trying to be harsh it's just that I know it works, and I need it done so I tried to get it done by myself and it didn't so I am now asking for help...
Not really. I just know that trying to use telepathy between a computer and a person doesn't work.
 
Old 09-01-2016, 02:39 AM   #14
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,627

Rep: Reputation: 7524Reputation: 7524Reputation: 7524Reputation: 7524Reputation: 7524Reputation: 7524Reputation: 7524Reputation: 7524Reputation: 7524Reputation: 7524Reputation: 7524
virtual memory (swap) is actually a partiton, some space on the hard drive. Nothing else. Keeping files/images/music whatever on disks has no any effect on human beings (not speaking about the event when the disk is destroyed and your valuable data will be vanished).
 
Old 09-01-2016, 03:43 AM   #15
Thirdeyematt
Member
 
Registered: Aug 2016
Posts: 31

Original Poster
Rep: Reputation: Disabled
Guys, I didn't come here to ask you whether or not this technology works. I know it works, if you don't think it works, then please don't post here.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] swap file, virtual memory Art McClure Slackware 2 04-08-2012 10:56 AM
Where to put Bash scripts written to run at various times to examine Alsa sound probs xologist Linux - Software 3 08-13-2008 10:09 AM
Difference between resident memory,shared memory and virtual memory in system monitor mathimca05 Linux - Newbie 1 11-11-2007 04:05 AM
Information for virtual memory file system peiwai Linux - Software 1 05-01-2006 12:09 PM
RH 8.0 Mapping Virtual Memory to get access to VMIC Reflective Memory PCI card. Merlin53 Linux - Hardware 0 05-05-2003 12:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration