amadornes / SCM-Localization-Issues

Localization and issues for Super Circuit Maker
16 stars 19 forks source link

Possible memory leak causing world to slow down #35

Open OverloadedWolf opened 7 years ago

OverloadedWolf commented 7 years ago

Now this was an interesting find. I was messing with SCM trying to use it with the endergenic generators and their tick timings. I had it working once. I left the world and loaded back in, only to find it not working and the non-SCM version to still be working, but running slower. I found this strange. So I went to break the circuit I set up only to find that everything had a delay or didn't break even though I know I broke it. Even more strange, I had thought about world ticks and so I placed a furnace down, had a delay opening inventory, and tried to smelt something. Lord behold, it was smelting extremely slowly. Now I have two theories on whats going on. There is either a memory leak filling up un-used space and not getting de-allocated, or something is messing with the world ticks that is causing this. I would like to aid in figuring this out, so message back soon.

Here is video of whats happening.

OverloadedWolf commented 7 years ago

I think I may have found the reason... not sure but... is it bad to use only glowing tiny redstone?

amadornes commented 7 years ago

Glowing redstone shouldn't cause any issues, no. That said, the tick time in your world is crazy slow O_o Could I have a copy of it to hook it up to a profiler and see what's leaking or taking so long to tick? I have a strange feeling it may have something to do with MCMultiPart, though I don't know why it would.

OverloadedWolf commented 7 years ago

Whats funny is I went and tried it out with the released version of MCMultiPart, it worked but didn't slow down as much... still slowed down. Was only getting around 7k RF/t where I should be getting about double. And yeah, I can zip it on over. One moment.

OverloadedWolf commented 7 years ago

Hm... After testing further, I went into a new FTB unstable with just SCM added, and so car no tick slowing has occured. Starting to make me think that it may be a separate mod that is causing the issue.

OverloadedWolf commented 7 years ago

Here is the link. https://drive.google.com/file/d/0B8xCWh44A21kOW5VQjAwa0lILW8/view?usp=sharing

amadornes commented 7 years ago

Pack is FTB Unstable + SCM, I imagine?

OverloadedWolf commented 7 years ago

That save there is. Yes. I had copied that from a separate pack that had FTB Unstable + Extra mods + SCM. I just made a new profile, only added SCM.

amadornes commented 7 years ago

Hmmm... Interesting... I don't have any TPS issues whatsoever in that world...

OverloadedWolf commented 7 years ago

Yeah. I think it was the inclusion of some mod that caused the drop in TPS.

amadornes commented 7 years ago

If anyone can reprouce it, let me know!

convict999 commented 7 years ago

tps issues.. (lame drum machine) noteblock on all sides fine, replace with redstone lamps its v bad! https://gist.github.com/2e962128549f39681c3adeef44146c93

long pulse extension used nearby in world... https://gist.github.com/3f2d474fa828e83b17fef1245d742ef6 activated with torch causes big spikes, noticeable with beat provided above

SonoSooS commented 7 years ago

I have a similar issue, except it slows down my entire system (blame Celeron), so I guess I have the same bug.

All I did, is I coldbooted into Minecraft, created a fresh superflat world, placed down 2 circuits boards, I turned one circuit board into a MUX circuit board with a blueprint, then started placing and removing the MUX circuit from the empty circuit board until the IC stopped rendering on the empty circuit board. From there the more I was looking at the empty circuit board with the MUX circuit in my hand, the slower my system got. Over time it got so slow, that the MUX circuit never got placed on the empty circuit board on right clicking, even after waiting a few minutes. Exiting and reloading the world at this point is useless, since reloading it still drops down to the same FPS. Even after a coldboot it drops down to the same FPS, so this bug seems to be affecting the world, not the global Minecraft instance. (as seen on this image) After further testing it looks like the circuit rendering (and ticking) my hotbar was slowing the game down so much. It looks like breaking and placing ICs constantly makes them slower and slower. Placing the item in a chest makes most lag to away (the game is still slower than a new world, but just only a few fps less). Because the rendering and the ticking of the item was taking too much CPU (and most likely GPU) power, I investigated my player file while holding a newly created MUX circuit and the laggy MUX circuit... oh boy! No wonder thy it's laggy! The NBT on the laggy IC is _SO HUGE_, that it took nbt2yaml almost 40seconds to process it :stuck_out_tongue:

I have attached my player file for investigation (but there's nothing to investigate other than the laggy circuit's NBT is _HUGE_ :stuck_out_tongue_winking_eye: )

player.dat.zip

I'm on 1.0.3 w/ Forge#2123

amadornes commented 7 years ago

Wow, thanks! This may actually be what was causing all the slowdowns on my previous dev worlds! I'll have a look :)

amadornes commented 7 years ago

I think @sfPlayer1 has figured it out! Turns out some of the old scheduled ticks weren't getting cleared, so a circuit on FC ended up having more than 2M scheduled ticks... >_> I'll look into fixing it in the next version :)