• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
myvraccount

Problem with PagedMemorySize64

17 posts in this topic

I'm using C#, and trying to figure out how much memory a process is using within the paging file or how much of its memory within physical RAM can be moved to the paging file if necessary.

 

Unless I'm mistaken (and I might be), the function PagedMemorySize64 is supposed to tell me how much is currently in the paging file, and PagedSystemMemorySize64 should tell me how much is in RAM but could be moved into the paging file at any time.

 

If those assumptions are correct, then so far so good.

 

However, even when "No paging file" is checked within my Virtual Memory properties window, these two functions both return positive numbers!  Why would that be?

 

Also, I opened the "Performance" tab on the Windows Task Manager, and in the section called "Kernel Memory (MB)" it says that "Paged" is a positive number (a pretty small number like in the hundreds, but I don't know if it's counting pages or bytes or what).

 

Am I imagining things, or is my computer actually using a paging file even when I tell it not to, or alternatively, do those paged memory size 64 functions not work or just not do what I think they do?

0

Share this post


Link to post
Share on other sites

Not a Beginners topic. Also, not relevant to games. Do you have an explanation for why you're asking this on Gamedev.net?

1

Share this post


Link to post
Share on other sites

OK then I guess like the other one, it should go in the General Programming forum.  That's "General" enough for it, right?  And how do you know it's not relevant for games anyway?  People save games in files all the time.  I'm really not trying to be snide, but just making a point.

0

Share this post


Link to post
Share on other sites

Here's the situation: not everything on these forums has to be 100% about game development, but it should at least be potentially relevant. Maybe because you're using it in a game context, or someone else would. Maybe because it uses techniques or technology used in game development. Or maybe the answer might tell us something about how to better make games or how to improve our programming.

Your last few threads have only had the most tenuous link to games development, made worse by your refusal to explain what you are doing or why you are doing it. "I'm having trouble with file code that I can't show you, in an app I won't tell you about, while doing weird things with virtual memory, but since games also use files it's relevant" is not a compelling response.

And it's not a one-off - it seems to be the case for all your threads these days. If you just want to continue asking off-topic questions, Stack Overflow is probably the best place for you. But if you'd prefer to keep posting here, show us how this is on-topic.

0

Share this post


Link to post
Share on other sites

OK sorry, but you don't have to close my threads like you just did with the other one.  I mean if you don't want to answer my question that's your business, but when you close it you prevent anyone else from possibly being able to answer it, even if they would have!

Oh, and also, if the "General Programming" must be about games then why is it called "General Programming"?

0

Share this post


Link to post
Share on other sites

As a moderator it's part of my job to keep these forums clear of irrelevant clutter. Keep your threads relevant and they won't be closed.

For the answer to your last question, please consult the first paragraph of my last response.

1

Share this post


Link to post
Share on other sites

Trying to address the original question ...

You need to do some reading to gain a much deeper understanding of how virtual memory works.  The last several questions on the topic show you have done almost no research, instead you just reach for likely-sounding names in the API and assume they do what you think they do rather than what they actually do.

PagedMemorySize64() documentation says it gives the value "Page File Bytes". That is private committed memory, which (if you have done your research you would know) is pageable memory your process owns and that you have written on. That is different from pageable memory your process owns but has not been committed.  None, some, or all of it may be located in a paging file. 

The system memory call is similar.

0

Share this post


Link to post
Share on other sites

Okay so just to actually answer this even if its not game related (will agree its more akin to something that should be on stack overflow) - but may as well get an answer.

Your assumptions on how they work are for the most part correct, however the PagedMemorySize64 will return a value even if page file size is set to 0 or its not using a page file - as stated by Microsoft on their docs "The property value is equivalent to the Page File Bytes performance counter for the process."

Which if you read into will show you that it returns the amount of virtual memory being used for paging files HOWEVER if there is no paging file it will show the amount of virtual memory that the process has reserved in physical memory.

So even with paging files set to 0 on usage, it will still return a value.


There, question answered so you dont have to re-post to stack overflow - #LockThreadKylo

But seriously, threads should be game related and I feel bad for answering this :( 

0

Share this post


Link to post
Share on other sites

Well thanks then GibbonThatCodes.  At least that tells me that I must be using the wrong function for what I'm trying to do, but I guess I'll still have to post to Stack Overflow or something to figure out which function I should use.

0

Share this post


Link to post
Share on other sites

An alternative is to go read the documentation of the C# library. No doubt it's a lot, so you won't know it all in one hour or even one evening, but the global picture of the kind of things that exist there will stick.

If you do that a few times, you start to know where to look more precisely. In a few months, you know all the relevant major things from that library without ever needing to ask or search.

While I agree that it is not the fastest way at first, assuming you will be programming for many many years, I do think your investment will pay for itself several times during your career, at least it did for me in several languages.

0

Share this post


Link to post
Share on other sites
22 minutes ago, Alberth said:

An alternative is to go read the documentation of the C# library. No doubt it's a lot, so you won't know it all in one hour or even one evening, but the global picture of the kind of things that exist there will stick.

Unfortunately this is a situation that won't work that way.

He's been posting about his security paranoia task for several months. He's spent the past four months asking questions that are WAY beyond the skill level of not just most programmers, but above most advanced security-industry software developers as well.

He started with asking ways to obfuscate the identity of the person who created a file, and ways to change the suspected author of a file. Then he went on to badly-implemented encryption code where he wouldn't post code out of fear it was insecure, then when code was posted it was full of serious security related bugs. Most recently he has been on a tangent of realizing the swap file is an attack vector for people who already have full access to the computer, so he's taking steps to attempt to block that route, too.  This is in spite of many people telling him over the past for months that his approach is completely the wrong direction and addresses threats that are not threats and ignores the real threats that fit his described concerns.

Learning to use MSDN won't help fix the problem he's got.

The problems he is trying to solve are problems that still exist in secure computing environments hosting classified materials.  The difference is that the security industry understands the actual threats.  He's spending his efforts on topics where if you have the ability to breach it then you've already lost, in this case the OS swap space.   I suspect future side-channel attacks will include disk free-space monitoring, CPU usage attacks, and ways that the "air gap" can be breached with regular microphones.

2

Share this post


Link to post
Share on other sites

It is possible to read the contents of RAM chips from a live machine too, if you have physical access to the memory bus lanes (and this is not as difficult as it may seem). While disabling the page file is a small hindrance to an attacker, it is not a very robust method on its own. If an attacker has physical access to the machine, be it powered on or not, he/she/it can bypass any protection implemented on that machine.

 

1

Share this post


Link to post
Share on other sites

But the attacker will not have physical access, unless you're expecting a criminal to break in.  I mean seriously, if the attacker has physical access then practicallly ANYTHING could happen!  I'm trying to prevent attacks through the Internet.  They can't arbitrarily read any data anywhere in ram through the Internet, can they?

 

And the reason I don't want stuff stored on the hard drive has more to do with what happens when the computer eventually gets thrown away and someone digs through the trash.

0

Share this post


Link to post
Share on other sites

Digging through the trash IS physical access. I don't know why you think of them as different.

There are industrial data disposal services for a reason. Use one if it really is that big of a deal for you.

Reading the swapfile is not possible over the internet unless you have a serious privilege escalation exploit abused on your machine. Again, you'd be better off protecting against real attack vectors instead of worrying about winning a losing battle. If someone can root your machine from the network, you've already lost, period. There's a reason why security competitions often only require you to pop up a calculator app to prove your ownership of a machine - because once you can execute arbitrary code, you win. Period.

If you are genuinely concerned about securing assets, you'd be much better served learning from actual security practices instead of chasing boogeymen.

0

Share this post


Link to post
Share on other sites

I'm quite curious as to what he's trying to do?  This looks more like he's trying to learn how to hack a program than to write one.  The more obscure 'modding' forums I've seen are filled with strange questions like these.

0

Share this post


Link to post
Share on other sites

Yes. I'd like to see the concerns about how relevant this subject is to game development addressed in future threads.

0

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0

  • Similar Content

    • By Scouting Ninja
      So I am working on a mobile game.
      It uses slides for a story, the slides are very large. Each slide is almost 2048*2048; the max texture loading size I am using for the game.
       
      My problem is that Unity keeps each slide in the memory after it's loaded, even when it will show only once per game. This leads to the game crashing on older mobiles.
      My idea was to destroy each object after it was shown using a coroutine, so it deletes the past slide and loads the next slide. This worked because instead of crashing on 23 slides it crashed on 48 slides.
      After some profiling I realized that destroy() isn't clearing all the memory that a slide used.
       
      What I want to do now is assign a limited amount of memory as a slide slot. Then I need some way to unload the slide from the slot, freeing the slot for the next slide; without Unity storing the slides in the memory.
      Any ideas on how I would do this? 
    • By INTwindwolf
      COMPANY AND THE PROJECT

      We are an indie game studio consisted of professional and friendly people. Additionally, we are a team of skilled artists and dedicated indie enthusiasts. Our current project is INT, developed on Unity Engine 5 for platforms Windows, Linux, and Mac.

      INT is a 3D Sci-fi RPG with a strong emphasis on story, role playing, and innovative RPG features such as randomized companions. The focus is on the journey through a war-torn world with fast-paced combat against hordes of enemies. The player must accomplish quests like a traditional RPG, complete objectives, and meet lively crew members who will aid in the player's survival. Throughout the game you can side and complete missions through criminal cartels, and the two major combatants, the UCE and ACP, of the Interstellar Civil War.
      For more information about us, follow the links listed below.
      INT Official website
      Steam Greenlight
      IndieDB page
      Also follow social media platforms for the latest news regarding our projects.
      Facebook
      Twitter
       
      TALENTS NEEDED
      Website Administrator
      Unity Engine Programmer
      Please note all of above are remote positions. You will not be required to travel or relocate.
       
      REVENUE-SHARE
      We are unable to offer wages or per-item payments at this time. However revenue-sharing from crowd-funding is offered to team members who contribute 15-20 hours per week to company projects, as well as maintain constant communication and adhere to deadlines. Currently the crowd-funding campaign is scheduled for the first half of year 2018. Your understanding is dearly appreciated.
       
      CONTACT
      Please click each position to view the job in detail, as well as application instructions.
      Thank you for your time! We look forward to hearing from you!
      John Shen
      HR Lead
      Starboard Games LLC
    • By Steven Ford
      Hi,
      I'm currently writing a level designer for my 2D game*. To do so, I'm writing this using c# / WinForms. The editor is designed to look a bit like VS, ie. a set of tool boxes surrounding a central panel to show the various tiles and game objects. I've got this central panel as a custom control (inheriting directly from Control) using custom rendering. The development machine that I'm using is using a 27" 4k display and so I've set Windows up to use a text zoom of 150% to avoid killing my eyes.
      Unfortunately, when I use my standard drawing code of (within the OnPaint override):
      var location = new System.Drawing.Point( offsetX + (tilePair.Key.X * tileLayer.TileSize.Width ), offsetY + (tilePair.Key.Y * tileLayer.TileSize.Height ) ); var destRectangle = new Rectangle( location, tileLayer.TileSize ); if( pe.ClipRectangle.IntersectsWith( destRectangle ) ) { pe.Graphics.DrawImage( tilePair.Value.Image, destRectangle, tilePair.Value.TileRectangle, GraphicsUnit.Pixel ); } The actual rendering is being done at 150% size of the destRectangle (~96 pixels vs. 64 that's expected). 
      This isn't necessarily a problem so long as I can source that scale factor in advance so I can ensure the appropriate resizing / layout code. Googling doesn't lead to much info on how to source this information and there's nothing obvious that I can find in intellisense as to give me pointers as to where to investigate further.
      So... does anyone have either any ideas as to how to solve this or links to places where I can investigate this sort of issue.
      Thanks in advance
      Steve
      *originally, I was using Tiled - which is rather good, but for various reasons I wanted to write my own. 1. so I can define custom objects with a fixed set of properties for level designers who aren't that technical to use and 2. to use it as a learning exercise around the command pattern.
    • By ilovegames
      This is very interesting and exciting puzzle game. The objective of the game is to help emergency services leave parking by the least count of turns. There is three different main car types in the game: fire engine, police car and ambulance. This game has 384 levels, with 128 levels for each emergency car. You can decide yourself how to play the game - reach the maximum amount of starts or simply solve the puzzles with no rush. 

      Unblock the Car game based on real animated 3D graphics, has perfect soundtrack and friendly user experience.

      Unblock the Car game is evolving your intellect, you can use this game to increase your grade level. It was designed for any age - from little kids to old people.
       
      UnblockTheCarSetup.exe
    • By MxHonesty
      We are a small team working on an ambitious project
      We decided to start working on this game a few weeks ago and finally managed to assamble a team of good and productive people, yet we still lack a writer and we would really need another programmer with experience in unity, given the complexity of the core mechanics.
      Our team is composed of 2 progammers and a 3D artist and a concept artist, Many members of our team have already worked on other games and projects, such as this.  And also this is a portfolio that contains some of our artwork.
      The game is set in a steampunk world ravaged by a mysterious plague and the core mechanics of the game revolve around the xcom-like turn-based combat, it's open world and resource management.
      We are currently working on a demo and eager to receive new members, You can join our discord. Or you can shoot us an email at day.dream.dives@gmail.com or a tweet at @AmonMx
       
       
  • Popular Now