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

Object Limit or Memory Limit #210

Closed
Dragon951 opened this issue Jan 4, 2018 · 3 comments
Closed

Object Limit or Memory Limit #210

Dragon951 opened this issue Jan 4, 2018 · 3 comments

Comments

@Dragon951
Copy link

Dragon951 commented Jan 4, 2018

Hello,

Is there a memory limit or a object limit with route viewer, ive been working on one of my Routes that are in development and some stations the objects will not load but in the psychical game, all objects load, can this please be explained, as well im having a problem with a some updated signals that are high quality but sometimes it would freeze route viewer, i never had this problem with low quality signals

but i feel i shouldn't be having this issue

i have a i7-7700K with a GTX 1080TI with 32Gb of ram, can this please be explained

@cwfitzgerald
Copy link
Contributor

cwfitzgerald commented Jan 4, 2018

There is a memory limit. As of right now all OpenBVE related programs run in 32bit mode, meaning they only have access to 2Gb of memory. This can cause a lot of issues when loading complex routes. As of right now the game loads all of the route at the same time, so it has to keep everything in memory at once.

The exception is the main game which has a flag flipped to allow it to access up to 3Gb of memory. This could be the causes of the difference in behavior.

I agree, you shouldn't be having this issue, but as of right now, there's not that much we can do about it besides allowing 64bit distributions, and I believe there was a reason we can't do that. @leezer3 will have a better answer.

leezer3 added a commit that referenced this issue Jan 4, 2018
@leezer3
Copy link
Owner

leezer3 commented Jan 4, 2018

It's a complicated situation, and really needs someone better with Win32 interop than me to sort out.

The issue is mixing 64-bit code (the simulator) and 32-bit code (Legacy Win32 train plugins).
By definition, a 64-bit process cannot load a 32-bit DLL.
Setting the openBVE API to AnyCPU seems to make .Net plugins work OK.

The probable solution would be to separate the plugins themselves from the simulation ( e.g. #195 ), and simply interact with a 32-bit plugin server type application.

I've added the LBA flag to RouteViewer for this build:
https://vps.bvecornwall.co.uk/OpenBVE/Builds/OpenBVE-2018-01-04.zip

It'll probably help at least some, but it would be interesting to see copies of what you're having issues with, especially the signals.

@cwfitzgerald
Copy link
Contributor

FWIW, I think the best solution would be to make a wrapper application for the plugin that the game can interact with using JSON/etc through the subprocess' stdin and stdout.

Generally speaking plugins suck :( (not openbve ones specifically, all of them)

@leezer3 leezer3 closed this as completed Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants